Bug 226439. Convert Seamonkey to EqualsLiteral. rs=darin

This commit is contained in:
roc+%cs.cmu.edu 2004-05-22 22:15:22 +00:00
Родитель cb1d177537
Коммит b8ecbc84da
170 изменённых файлов: 704 добавлений и 1337 удалений

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

@ -1551,7 +1551,7 @@ nsresult nsAccessibilityService::GetAccessible(nsIDOMNode *aNode,
nsCOMPtr<nsIDOMElement> element(do_QueryInterface(aNode));
if (element) {
element->GetAttribute(NS_LITERAL_STRING("type"), attrib);
if (attrib.Equals(NS_LITERAL_STRING("checkbox")))
if (attrib.EqualsLiteral("checkbox"))
printf("## aaronl debugging attribute\n");
}
#endif

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

@ -130,7 +130,7 @@ NS_IMETHODIMP nsRootAccessible::GetRole(PRUint32 *aRole)
if (rootElement) {
nsAutoString name;
rootElement->GetLocalName(name);
if (name.Equals(NS_LITERAL_STRING("dialog")))
if (name.EqualsLiteral("dialog"))
*aRole = ROLE_DIALOG;
}
}

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

@ -67,7 +67,7 @@ NS_IMETHODIMP nsXULMenuitemAccessible::GetState(PRUint32 *_retval)
// Has Popup?
nsAutoString tagName;
element->GetLocalName(tagName);
if (tagName.Equals(NS_LITERAL_STRING("menu")))
if (tagName.EqualsLiteral("menu"))
*_retval |= STATE_HASPOPUP;
nsAutoString menuItemType;
@ -75,7 +75,7 @@ NS_IMETHODIMP nsXULMenuitemAccessible::GetState(PRUint32 *_retval)
if (!menuItemType.IsEmpty()) {
// Selectable?
if (menuItemType.Equals(NS_LITERAL_STRING("radio")))
if (menuItemType.EqualsLiteral("radio"))
*_retval |= STATE_SELECTABLE;
// Checked?
@ -189,7 +189,7 @@ NS_IMETHODIMP nsXULMenuitemAccessible::GetChildCount(PRInt32 *aAccChildCount)
nodeList->Item(childIndex, getter_AddRefs(childNode));
nsAutoString nodeName;
childNode->GetNodeName(nodeName);
if (nodeName.Equals(NS_LITERAL_STRING("menupopup"))) {
if (nodeName.EqualsLiteral("menupopup")) {
break;
}
}
@ -199,7 +199,7 @@ NS_IMETHODIMP nsXULMenuitemAccessible::GetChildCount(PRInt32 *aAccChildCount)
if (element) {
nsAutoString attr;
element->GetAttribute(NS_LITERAL_STRING("menugenerated"), attr);
if (!attr.Equals(NS_LITERAL_STRING("true"))) {
if (!attr.EqualsLiteral("true")) {
element->SetAttribute(NS_LITERAL_STRING("menugenerated"), NS_LITERAL_STRING("true"));
}
}

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

@ -364,7 +364,7 @@ NS_IMETHODIMP nsXULListboxAccessible::GetState(PRUint32 *_retval)
if (element) {
nsAutoString selType;
element->GetAttribute(NS_LITERAL_STRING("seltype"), selType);
if (!selType.IsEmpty() && selType.Equals(NS_LITERAL_STRING("multiple")))
if (!selType.IsEmpty() && selType.EqualsLiteral("multiple"))
*_retval |= STATE_MULTISELECTABLE;
}
@ -419,7 +419,7 @@ NS_IMETHODIMP nsXULListitemAccessible::GetName(nsAString& _retval)
if (childElement) {
nsAutoString tagName;
childElement->GetLocalName(tagName);
if (tagName.Equals(NS_LITERAL_STRING("listcell"))) {
if (tagName.EqualsLiteral("listcell")) {
childElement->GetAttribute(NS_LITERAL_STRING("label"), _retval);
return NS_OK;
}

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

@ -70,7 +70,7 @@ void nsXULTreeAccessible::GetTreeBoxObject(nsIDOMNode *aDOMNode, nsITreeBoxObjec
currentNode = aDOMNode;
while (currentNode) {
currentNode->GetLocalName(name);
if (name.Equals(NS_LITERAL_STRING("tree"))) {
if (name.EqualsLiteral("tree")) {
// We will get the nsITreeBoxObject from the tree node
nsCOMPtr<nsIDOMXULElement> xulElement(do_QueryInterface(currentNode));
if (xulElement) {
@ -102,7 +102,7 @@ NS_IMETHODIMP nsXULTreeAccessible::GetState(PRUint32 *_retval)
// the default selection type is multiple
nsAutoString selType;
element->GetAttribute(NS_LITERAL_STRING("seltype"), selType);
if (selType.IsEmpty() || !selType.Equals(NS_LITERAL_STRING("single")))
if (selType.IsEmpty() || !selType.EqualsLiteral("single"))
*_retval |= STATE_MULTISELECTABLE;
}
@ -343,7 +343,7 @@ NS_IMETHODIMP nsXULTreeAccessible::SelectAllSelection(PRBool *_retval)
if (element) {
nsAutoString selType;
element->GetAttribute(NS_LITERAL_STRING("seltype"), selType);
if (selType.IsEmpty() || !selType.Equals(NS_LITERAL_STRING("single"))) {
if (selType.IsEmpty() || !selType.EqualsLiteral("single")) {
*_retval = PR_TRUE;
nsCOMPtr<nsITreeSelection> selection;
mTreeView->GetSelection(getter_AddRefs(selection));
@ -630,7 +630,7 @@ NS_IMETHODIMP nsXULTreeitemAccessible::GetBounds(PRInt32 *x, PRInt32 *y, PRInt32
for (childIndex = 0; childIndex < childCount; childIndex++) {
childNodes->Item(childIndex, getter_AddRefs(childNode));
childNode->GetLocalName(name);
if (name.Equals(NS_LITERAL_STRING("treechildren"))) {
if (name.EqualsLiteral("treechildren")) {
nsCOMPtr<nsIDOMXULElement> xulElement(do_QueryInterface(childNode));
if (xulElement) {
nsCOMPtr<nsIBoxObject> box;

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

@ -252,14 +252,14 @@ nsScriptSecurityManager::SecurityCompareURIs(nsIURI* aSourceURI,
rv = sourceBaseURI->GetScheme(sourceScheme);
if (NS_SUCCEEDED(rv) && targetScheme.Equals(sourceScheme))
{
if (targetScheme.Equals(NS_LITERAL_CSTRING("file")))
if (targetScheme.EqualsLiteral("file"))
{
// All file: urls are considered to have the same origin.
*result = PR_TRUE;
}
else if (targetScheme.Equals(NS_LITERAL_CSTRING("imap")) ||
targetScheme.Equals(NS_LITERAL_CSTRING("mailbox")) ||
targetScheme.Equals(NS_LITERAL_CSTRING("news")))
else if (targetScheme.EqualsLiteral("imap") ||
targetScheme.EqualsLiteral("mailbox") ||
targetScheme.EqualsLiteral("news"))
{
// Each message is a distinct trust domain; use the
// whole spec for comparison

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

@ -964,7 +964,7 @@ nsTransferableFactory::GetAnchorURL(nsIDOMNode* inNode, nsAString& outURL)
nsCOMPtr<nsIContent> content(do_QueryInterface(inNode));
nsAutoString value;
content->GetAttr(kNameSpaceID_XLink, nsHTMLAtoms::type, value);
if (value.Equals(NS_LITERAL_STRING("simple"))) {
if (value.EqualsLiteral("simple")) {
content->GetAttr(kNameSpaceID_XLink, nsHTMLAtoms::href, value);
if (!value.IsEmpty()) {
nsCOMPtr<nsIURI> baseURI = content->GetBaseURI();

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

@ -370,8 +370,8 @@ nsDOMImplementation::CreateDocument(const nsAString& aNamespaceURI,
if (colon &&
(DOMStringIsNull(aNamespaceURI) ||
(Substring(qName.get(), colon).Equals(NS_LITERAL_STRING("xml")) &&
!aNamespaceURI.Equals(NS_LITERAL_STRING("http://www.w3.org/XML/1998/namespace"))))) {
(Substring(qName.get(), colon).EqualsLiteral("xml") &&
!aNamespaceURI.EqualsLiteral("http://www.w3.org/XML/1998/namespace")))) {
return NS_ERROR_DOM_NAMESPACE_ERR;
}
}
@ -1121,7 +1121,7 @@ nsDocument::SetHeaderData(nsIAtom* aHeaderField, const nsAString& aData)
for (index = 0; index < count; index++) {
nsIStyleSheet* sheet = mStyleSheets[index];
sheet->GetType(type);
if (!type.Equals(NS_LITERAL_STRING("text/html"))) {
if (!type.EqualsLiteral("text/html")) {
sheet->GetTitle(title);
if (!title.IsEmpty()) { // if sheet has title
PRBool enabled =
@ -2354,7 +2354,7 @@ nsDocument::GetElementsByTagNameNS(const nsAString& aNamespaceURI,
nsCOMPtr<nsIContentList> list;
if (!aNamespaceURI.Equals(NS_LITERAL_STRING("*"))) {
if (!aNamespaceURI.EqualsLiteral("*")) {
nsContentUtils::GetNSManagerWeakRef()->GetNameSpaceID(aNamespaceURI,
&nameSpaceId);
@ -2590,7 +2590,7 @@ nsDocument::GetAnonymousElementByAttribute(nsIDOMElement* aElement,
PRUint32 length;
nodeList->GetLength(&length);
PRBool universalMatch = aAttrValue.Equals(NS_LITERAL_STRING("*"));
PRBool universalMatch = aAttrValue.EqualsLiteral("*");
for (PRUint32 i = 0; i < length; ++i) {
nsCOMPtr<nsIDOMNode> current;
@ -4000,10 +4000,10 @@ nsDocument::SetXMLDeclaration(const nsAString& aVersion,
mXMLDeclarationBits |= XML_DECLARATION_BITS_ENCODING_EXISTS;
}
if (aStandalone.Equals(NS_LITERAL_STRING("yes"))) {
if (aStandalone.EqualsLiteral("yes")) {
mXMLDeclarationBits |= XML_DECLARATION_BITS_STANDALONE_EXISTS |
XML_DECLARATION_BITS_STANDALONE_YES;
} else if (aStandalone.Equals(NS_LITERAL_STRING("no"))) {
} else if (aStandalone.EqualsLiteral("no")) {
mXMLDeclarationBits |= XML_DECLARATION_BITS_STANDALONE_EXISTS;
}
}

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

@ -1606,7 +1606,7 @@ nsHTMLCopyEncoder::IsMozBR(nsIDOMNode* aNode)
nsAutoString typeAttrVal;
nsresult rv = elem->GetAttribute(typeAttrName, typeAttrVal);
ToLowerCase(typeAttrVal);
if (NS_SUCCEEDED(rv) && (typeAttrVal.Equals(NS_LITERAL_STRING("_moz"))))
if (NS_SUCCEEDED(rv) && (typeAttrVal.EqualsLiteral("_moz")))
return PR_TRUE;
}
return PR_FALSE;

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

@ -2820,7 +2820,7 @@ DocumentViewerImpl::GetPopupLinkNode(nsIDOMNode** aNode)
}
}
}
if (anchor || area || link || xlinkType.Equals(NS_LITERAL_STRING("simple"))) {
if (anchor || area || link || xlinkType.EqualsLiteral("simple")) {
*aNode = node;
NS_IF_ADDREF(*aNode); // addref
return NS_OK;

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

@ -489,7 +489,7 @@ nsFrameLoader::EnsureDocShell()
nsAutoString::const_char_iterator iter(start + 7);
isContent = Substring(start, iter) == NS_LITERAL_STRING("content") &&
isContent = Substring(start, iter).EqualsLiteral("content") &&
(iter == end || *iter == '-');
}
@ -513,7 +513,7 @@ nsFrameLoader::EnsureDocShell()
if (parentTreeOwner) {
PRBool is_primary = parentType == nsIDocShellTreeItem::typeChrome &&
value == NS_LITERAL_STRING("content-primary");
value.EqualsLiteral("content-primary");
parentTreeOwner->ContentShellAdded(docShellAsItem, is_primary,
value.get());

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

@ -1533,7 +1533,7 @@ nsGenericElement::GetElementsByTagNameNS(const nsAString& aNamespaceURI,
nsCOMPtr<nsIContentList> list;
if (!aNamespaceURI.Equals(NS_LITERAL_STRING("*"))) {
if (!aNamespaceURI.EqualsLiteral("*")) {
nsContentUtils::GetNSManagerWeakRef()->GetNameSpaceID(aNamespaceURI,
&nameSpaceId);

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

@ -591,7 +591,7 @@ HandleImagePLEvent(PLEvent* aEvent)
nsEventStatus estatus = nsEventStatus_eIgnore;
PRUint32 eventMsg;
if (evt->mMessage == NS_LITERAL_STRING("load")) {
if (evt->mMessage.EqualsLiteral("load")) {
eventMsg = NS_IMAGE_LOAD;
} else {
eventMsg = NS_IMAGE_ERROR;

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

@ -1152,7 +1152,7 @@ nsPlainTextSerializer::DoAddLeaf(const nsIParserNode *aNode, PRInt32 aTag,
// ignore the bogus br tags that the editor sticks here and there.
nsAutoString typeAttr;
if (NS_FAILED(GetAttributeValue(aNode, nsHTMLAtoms::type, typeAttr))
|| !typeAttr.Equals(NS_LITERAL_STRING("_moz"))) {
|| !typeAttr.EqualsLiteral("_moz")) {
EnsureVerticalSpace(mEmptyLines+1);
}
}
@ -1507,7 +1507,7 @@ nsPlainTextSerializer::EndLine(PRBool aSoftlinebreak)
// (see RFC 2646). We only check for "-- " when it's a hard line
// break for obvious reasons.
if(!(mFlags & nsIDocumentEncoder::OutputPreformatted) &&
(aSoftlinebreak || !mCurrentLine.Equals(NS_LITERAL_STRING("-- ")))) {
(aSoftlinebreak || !mCurrentLine.EqualsLiteral("-- "))) {
// Remove SPACE:s from the end of the line.
while(currentlinelength > 0 &&
mCurrentLine[currentlinelength-1] == ' ') {

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

@ -252,7 +252,7 @@ nsTextNode::DumpContent(FILE* out, PRInt32 aIndent, PRBool aDumpAll) const
nsAutoString tmp;
ToCString(tmp, 0, mText.GetLength());
if(!tmp.Equals(NS_LITERAL_STRING("\\n"))) {
if(!tmp.EqualsLiteral("\\n")) {
fputs(NS_LossyConvertUCS2toASCII(tmp).get(), out);
if(aIndent) fputs("\n", out);
}

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

@ -382,36 +382,36 @@ nsEventStateManager::Observe(nsISupports *aSubject,
return NS_OK;
nsDependentString data(someData);
if (data.Equals(NS_LITERAL_STRING("accessibility.accesskeycausesactivation"))) {
if (data.EqualsLiteral("accessibility.accesskeycausesactivation")) {
sKeyCausesActivation =
nsContentUtils::GetBoolPref("accessibility.accesskeycausesactivation",
sKeyCausesActivation);
} else if (data.Equals(NS_LITERAL_STRING("accessibility.browsewithcaret"))) {
} else if (data.EqualsLiteral("accessibility.browsewithcaret")) {
ResetBrowseWithCaret();
} else if (data.Equals(NS_LITERAL_STRING("accessibility.tabfocus"))) {
} else if (data.EqualsLiteral("accessibility.tabfocus")) {
sTabFocusModel = nsContentUtils::GetIntPref("accessibility.tabfocus",
sTabFocusModel);
} else if (data.Equals(NS_LITERAL_STRING("nglayout.events.dispatchLeftClickOnly"))) {
} else if (data.EqualsLiteral("nglayout.events.dispatchLeftClickOnly")) {
sLeftClickOnly =
nsContentUtils::GetBoolPref("nglayout.events.dispatchLeftClickOnly",
sLeftClickOnly);
} else if (data.Equals(NS_LITERAL_STRING("ui.key.generalAccessKey"))) {
} else if (data.EqualsLiteral("ui.key.generalAccessKey")) {
sGeneralAccesskeyModifier =
nsContentUtils::GetIntPref("ui.key.generalAccessKey",
sGeneralAccesskeyModifier);
#if 0
} else if (data.Equals(NS_LITERAL_STRING("mousewheel.withaltkey.action"))) {
} else if (data.Equals(NS_LITERAL_STRING("mousewheel.withaltkey.numlines"))) {
} else if (data.Equals(NS_LITERAL_STRING("mousewheel.withaltkey.sysnumlines"))) {
} else if (data.Equals(NS_LITERAL_STRING("mousewheel.withcontrolkey.action"))) {
} else if (data.Equals(NS_LITERAL_STRING("mousewheel.withcontrolkey.numlines"))) {
} else if (data.Equals(NS_LITERAL_STRING("mousewheel.withcontrolkey.sysnumlines"))) {
} else if (data.Equals(NS_LITERAL_STRING("mousewheel.withshiftkey.action"))) {
} else if (data.Equals(NS_LITERAL_STRING("mousewheel.withshiftkey.numlines"))) {
} else if (data.Equals(NS_LITERAL_STRING("mousewheel.withshiftkey.sysnumlines"))) {
} else if (data.Equals(NS_LITERAL_STRING("mousewheel.withnokey.action"))) {
} else if (data.Equals(NS_LITERAL_STRING("mousewheel.withnokey.numlines"))) {
} else if (data.Equals(NS_LITERAL_STRING("mousewheel.withnokey.sysnumlines"))) {
} else if (data.EqualsLiteral("mousewheel.withaltkey.action")) {
} else if (data.EqualsLiteral("mousewheel.withaltkey.numlines")) {
} else if (data.EqualsLiteral("mousewheel.withaltkey.sysnumlines")) {
} else if (data.EqualsLiteral("mousewheel.withcontrolkey.action")) {
} else if (data.EqualsLiteral("mousewheel.withcontrolkey.numlines")) {
} else if (data.EqualsLiteral("mousewheel.withcontrolkey.sysnumlines")) {
} else if (data.EqualsLiteral("mousewheel.withshiftkey.action")) {
} else if (data.EqualsLiteral("mousewheel.withshiftkey.numlines")) {
} else if (data.EqualsLiteral("mousewheel.withshiftkey.sysnumlines")) {
} else if (data.EqualsLiteral("mousewheel.withnokey.action")) {
} else if (data.EqualsLiteral("mousewheel.withnokey.numlines")) {
} else if (data.EqualsLiteral("mousewheel.withnokey.sysnumlines")) {
#endif
}
}
@ -3710,7 +3710,7 @@ nsEventStateManager::GetNextTabbableContent(nsIContent* aRootContent,
PRInt32 errorCode;
tabIndex = tabStr.ToInteger(&errorCode);
}
if (!value.Equals(NS_LITERAL_STRING("true"))) {
if (!value.EqualsLiteral("true")) {
nsCOMPtr<nsIDOMXULControlElement> control(do_QueryInterface(child));
if (control)
control->GetDisabled(&disabled);
@ -4871,7 +4871,7 @@ nsEventStateManager::MoveFocusToCaret(PRBool aCanFocusDoc,
if (*aIsSelectionWithFocus) {
nsAutoString xlinkType;
testContent->GetAttr(kNameSpaceID_XLink, nsHTMLAtoms::type, xlinkType);
if (!xlinkType.Equals(NS_LITERAL_STRING("simple"))) {
if (!xlinkType.EqualsLiteral("simple")) {
*aIsSelectionWithFocus = PR_FALSE; // Xlink must be type="simple"
}
}

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

@ -1336,7 +1336,7 @@ nsFormSubmission::GetEncoder(nsIHTMLContent* aForm,
nsresult rv = NS_OK;
nsCAutoString charset(aCharset);
if(charset.Equals(NS_LITERAL_CSTRING("ISO-8859-1")))
if(charset.EqualsLiteral("ISO-8859-1"))
charset.Assign(NS_LITERAL_CSTRING("windows-1252"));
rv = CallCreateInstance( NS_SAVEASCHARSET_CONTRACTID, aEncoder);
@ -1458,7 +1458,7 @@ nsFormSubmission::ProcessValue(nsIDOMHTMLElement* aSource,
const nsAString& aName, const nsAString& aValue)
{
// Hijack _charset_ (hidden inputs only) for internationalization (bug 18643)
if (aName == NS_LITERAL_STRING("_charset_")) {
if (aName.EqualsLiteral("_charset_")) {
nsCOMPtr<nsIFormControl> formControl = do_QueryInterface(aSource);
if (formControl) {
if (formControl->GetType() == NS_FORM_INPUT_HIDDEN) {

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

@ -2432,7 +2432,7 @@ nsHTMLInputElement::RestoreState(nsIPresState* aState)
nsAutoString checked;
rv = aState->GetStateProperty(NS_LITERAL_STRING("checked"), checked);
if (rv == NS_STATE_PROPERTY_EXISTS) {
DoSetChecked(checked.Equals(NS_LITERAL_STRING("t")), PR_FALSE);
DoSetChecked(checked.EqualsLiteral("t"), PR_FALSE);
}
break;
}
@ -2455,7 +2455,7 @@ nsHTMLInputElement::RestoreState(nsIPresState* aState)
nsresult rv2 = aState->GetStateProperty(NS_LITERAL_STRING("disabled"), disabled);
NS_ASSERTION(NS_SUCCEEDED(rv2), "disabled restore failed!");
if (rv2 == NS_STATE_PROPERTY_EXISTS) {
SetDisabled(disabled.Equals(NS_LITERAL_STRING("t")));
SetDisabled(disabled.EqualsLiteral("t"));
}
if (NS_FAILED(rv|rv2)) {

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

@ -814,7 +814,7 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
// Use the channel's charset (e.g., charset from HTTP
// "Content-Type" header).
}
else if (!scheme.Equals(NS_LITERAL_CSTRING("about")) && // don't try to access bookmarks for about:blank
else if (!scheme.EqualsLiteral("about") && // don't try to access bookmarks for about:blank
TryBookmarkCharset(docShell, aChannel, charsetSource, charset)) {
// Use the bookmark's charset.
}
@ -839,7 +839,7 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
nsCAutoString methodStr;
rv = httpChannel->GetRequestMethod(methodStr);
isPostPage = (NS_SUCCEEDED(rv) &&
methodStr.Equals(NS_LITERAL_CSTRING("POST")));
methodStr.EqualsLiteral("POST"));
}
if (isPostPage && muCV && kCharsetFromHintPrevDoc > charsetSource) {

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

@ -439,13 +439,13 @@ nsImageDocument::HandleEvent(nsIDOMEvent* aEvent)
{
nsAutoString eventType;
aEvent->GetType(eventType);
if (eventType.Equals(NS_LITERAL_STRING("resize"))) {
if (eventType.EqualsLiteral("resize")) {
CheckOverflowing();
}
else if (eventType.Equals(NS_LITERAL_STRING("click"))) {
else if (eventType.EqualsLiteral("click")) {
ToggleImageSize();
}
else if (eventType.Equals(NS_LITERAL_STRING("keypress"))) {
else if (eventType.EqualsLiteral("keypress")) {
nsCOMPtr<nsIDOMKeyEvent> keyEvent = do_QueryInterface(aEvent);
PRUint32 charCode;
keyEvent->GetCharCode(&charCode);

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

@ -814,7 +814,7 @@ nsCSSDeclaration::TryBorderShorthand(nsAString & aString, PRUint32 aPropertiesSe
nsAutoString valueString;
AppendValueToString(eCSSProperty_border_top_color, valueString);
if (!valueString.Equals(NS_LITERAL_STRING("-moz-use-text-color"))) {
if (!valueString.EqualsLiteral("-moz-use-text-color")) {
/* don't output this value, it's proprietary Mozilla and */
/* not intended to be exposed ; we can remove it from the */
/* values of the shorthand since this value represents the */
@ -848,7 +848,7 @@ nsCSSDeclaration::TryBorderSideShorthand(nsAString & aString,
nsAutoString valueString;
AppendValueToString(OrderValueAt(aBorderColor-1), valueString);
if (!valueString.Equals(NS_LITERAL_STRING("-moz-use-text-color"))) {
if (!valueString.EqualsLiteral("-moz-use-text-color")) {
aString.Append(NS_LITERAL_STRING(" "));
aString.Append(valueString);
}

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

@ -769,8 +769,8 @@ SheetLoadData::OnStreamComplete(nsIUnicharStreamLoader* aLoader,
channel->GetContentType(contentType);
}
PRBool validType = contentType.Equals(NS_LITERAL_CSTRING("text/css")) ||
contentType.Equals(NS_LITERAL_CSTRING(UNKNOWN_CONTENT_TYPE)) ||
PRBool validType = contentType.EqualsLiteral("text/css") ||
contentType.EqualsLiteral(UNKNOWN_CONTENT_TYPE) ||
contentType.IsEmpty();
if (mLoader->mCompatMode == eCompatibility_NavQuirks || validType) {

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

@ -487,7 +487,7 @@ PRBool nsStyleUtil::IsSimpleXlink(nsIContent *aContent, nsIPresContext *aPresCon
// see if it is type=simple (we don't deal with other types)
nsAutoString val;
aContent->GetAttr(kNameSpaceID_XLink, nsHTMLAtoms::type, val);
if (val == NS_LITERAL_STRING("simple")) {
if (val.EqualsLiteral("simple")) {
// see if there is an xlink namespace'd href attribute:
// - get it if there is, if not no big deal, it is not required for xlinks
// is it bad to re-use val here?

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

@ -1272,7 +1272,7 @@ nsXBLBinding::IsInExcludesList(nsIAtom* aTag, const nsString& aList)
nsAutoString element;
aTag->ToString(element);
if (aList == NS_LITERAL_STRING("*"))
if (aList.EqualsLiteral("*"))
return PR_TRUE; // match _everything_!
PRInt32 indx = aList.Find(element, 0);

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

@ -658,7 +658,7 @@ nsXBLContentSink::ConstructResource(const PRUnichar **aAtts,
}
// Is this attribute one of the ones we care about?
if (key.Equals(NS_LITERAL_STRING("src"))) {
if (key.EqualsLiteral("src")) {
mBinding->AddResource(aResourceType, nsDependentString(aAtts[1]));
break;
}

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

@ -324,7 +324,7 @@ nsXBLPrototypeBinding::SetBindingElement(nsIContent* aElement)
mBinding = aElement;
nsAutoString inheritStyle;
mBinding->GetAttr(kNameSpaceID_None, nsXBLAtoms::inheritstyle, inheritStyle);
if (inheritStyle == NS_LITERAL_STRING("false"))
if (inheritStyle.EqualsLiteral("false"))
mInheritStyle = PR_FALSE;
}

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

@ -298,7 +298,7 @@ nsXBLPrototypeHandler::ExecuteHandler(nsIDOMEventReceiver* aReceiver,
nsAutoString type;
mEventName->ToString(type);
if (type == NS_LITERAL_STRING("keypress") &&
if (type.EqualsLiteral("keypress") &&
mDetail == nsIDOMKeyEvent::DOM_VK_SPACE &&
mMisc == 1) {
// get the focused element so that we can pageDown only at
@ -324,7 +324,7 @@ nsXBLPrototypeHandler::ExecuteHandler(nsIDOMEventReceiver* aReceiver,
nsAutoString type;
content->GetAttr(kNameSpaceID_XLink, nsHTMLAtoms::type, type);
isLink = type.Equals(NS_LITERAL_STRING("simple"));
isLink = type.EqualsLiteral("simple");
if (isLink) {
break;
@ -859,9 +859,9 @@ nsXBLPrototypeHandler::ConstructPrototype(nsIContent* aKeyElement,
if (aPhase) {
const nsDependentString phase(aPhase);
if (phase.Equals(NS_LITERAL_STRING("capturing")))
if (phase.EqualsLiteral("capturing"))
mPhase = NS_PHASE_CAPTURING;
else if (phase.Equals(NS_LITERAL_STRING("target")))
else if (phase.EqualsLiteral("target"))
mPhase = NS_PHASE_TARGET;
}
@ -941,7 +941,7 @@ nsXBLPrototypeHandler::ConstructPrototype(nsIContent* aKeyElement,
}
nsAutoString preventDefault(aPreventDefault);
if (preventDefault.Equals(NS_LITERAL_STRING("true")))
if (preventDefault.EqualsLiteral("true"))
mType |= NS_HANDLER_TYPE_PREVENTDEFAULT;
}

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

@ -317,7 +317,7 @@ nsXBLWindowHandler::WalkHandlersInternal(nsIDOMEvent* aEvent,
if (commandElt)
commandElt->GetAttribute(NS_LITERAL_STRING("disabled"), disabled);
if (!disabled.Equals(NS_LITERAL_STRING("true"))) {
if (!disabled.EqualsLiteral("true")) {
nsCOMPtr<nsIDOMEventReceiver> rec = mReceiver;
if (mElement)
rec = do_QueryInterface(commandElt);

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

@ -141,7 +141,7 @@ nsXMLElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, nsIAtom* aPrefix,
// we do not need to check other attributes. If there
// is no href attribute, then this link is simply
// untraversible [XLink 3.2].
mIsLink = aValue.Equals(NS_LITERAL_STRING("simple"));
mIsLink = aValue.EqualsLiteral("simple");
// We will check for actuate="onLoad" in MaybeTriggerAutoLink
}
@ -226,7 +226,7 @@ nsXMLElement::MaybeTriggerAutoLink(nsIDocShell *aShell)
break;
// XXX Should probably do this using atoms
if (value.Equals(NS_LITERAL_STRING("new"))) {
if (value.EqualsLiteral("new")) {
if (nsContentUtils::GetBoolPref("dom.disable_open_during_load")) {
// disabling open during load
@ -237,12 +237,12 @@ nsXMLElement::MaybeTriggerAutoLink(nsIDocShell *aShell)
// not blocking new windows
verb = eLinkVerb_New;
}
} else if (value.Equals(NS_LITERAL_STRING("replace"))) {
} else if (value.EqualsLiteral("replace")) {
// We want to actually stop processing the current document now.
// We do this by returning the correct value so that the one
// that called us knows to stop processing.
verb = eLinkVerb_Replace;
} else if (value.Equals(NS_LITERAL_STRING("embed"))) {
} else if (value.EqualsLiteral("embed")) {
// XXX TODO
break;
}
@ -325,13 +325,13 @@ nsXMLElement::HandleDOMEvent(nsIPresContext* aPresContext,
show);
// XXX Should probably do this using atoms
if (show.Equals(NS_LITERAL_STRING("new"))) {
if (show.EqualsLiteral("new")) {
if (!nsContentUtils::GetBoolPref("browser.block.target_new_window")) {
verb = eLinkVerb_New;
}
} else if (show.Equals(NS_LITERAL_STRING("replace"))) {
} else if (show.EqualsLiteral("replace")) {
verb = eLinkVerb_Replace;
} else if (show.Equals(NS_LITERAL_STRING("embed"))) {
} else if (show.EqualsLiteral("embed")) {
verb = eLinkVerb_Embed;
}

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

@ -46,7 +46,7 @@ NS_NewXMLProcessingInstruction(nsIContent** aInstancePtrResult,
const nsAString& aTarget,
const nsAString& aData)
{
if (aTarget.Equals(NS_LITERAL_STRING("xml-stylesheet"))) {
if (aTarget.EqualsLiteral("xml-stylesheet")) {
return NS_NewXMLStylesheetProcessingInstruction(aInstancePtrResult, aData);
}
*aInstancePtrResult = new nsXMLProcessingInstruction(aTarget, aData);

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

@ -202,7 +202,7 @@ nsXMLStylesheetPI::GetStyleSheetInfo(nsAString& aTitle,
GetAttrValue(NS_LITERAL_STRING("alternate"), alternate);
// if alternate, does it have title?
if (alternate.Equals(NS_LITERAL_STRING("yes"))) {
if (alternate.EqualsLiteral("yes")) {
if (aTitle.IsEmpty()) { // alternates must have title
return;
} else {

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

@ -199,7 +199,7 @@ nsXMLContentSink::WillBuildModel(void)
if (mPrettyPrintXML) {
nsAutoString command;
mParser->GetCommand(command);
if (!command.Equals(NS_LITERAL_STRING("view"))) {
if (!command.EqualsLiteral("view")) {
mPrettyPrintXML = PR_FALSE;
}
}
@ -1328,7 +1328,7 @@ nsXMLContentSink::HandleProcessingInstruction(const PRUnichar *aTarget,
nsAutoString type;
nsParserUtils::GetQuotedAttributeValue(data, NS_LITERAL_STRING("type"), type);
if (mState == eXMLContentSinkState_InProlog &&
target.Equals(NS_LITERAL_STRING("xml-stylesheet")) &&
target.EqualsLiteral("xml-stylesheet") &&
!type.EqualsIgnoreCase("text/css")) {
nsAutoString href, title, media, alternate;
@ -1346,7 +1346,7 @@ nsXMLContentSink::HandleProcessingInstruction(const PRUnichar *aTarget,
nsParserUtils::GetQuotedAttributeValue(data, NS_LITERAL_STRING("alternate"), alternate);
result = ProcessStyleLink(node, href, alternate.Equals(NS_LITERAL_STRING("yes")),
result = ProcessStyleLink(node, href, alternate.EqualsLiteral("yes"),
title, type, media);
}
}

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

@ -520,9 +520,9 @@ nsXMLDocument::Load(const nsAString& aUrl, PRBool *aReturn)
if (node) {
nsAutoString name, ns;
if (NS_SUCCEEDED(node->GetLocalName(name)) &&
name.Equals(NS_LITERAL_STRING("parsererror")) &&
name.EqualsLiteral("parsererror") &&
NS_SUCCEEDED(node->GetNamespaceURI(ns)) &&
ns.Equals(NS_LITERAL_STRING("http://www.mozilla.org/newlayout/xml/parsererror.xml"))) {
ns.EqualsLiteral("http://www.mozilla.org/newlayout/xml/parsererror.xml")) {
//return is already false
} else {
*aReturn = PR_TRUE;

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

@ -106,7 +106,7 @@ nsXMLPrettyPrinter::PrettyPrint(nsIDocument* aDocument)
nsAutoString visibility;
computedStyle->GetPropertyValue(NS_LITERAL_STRING("visibility"),
visibility);
if (!visibility.Equals(NS_LITERAL_STRING("visible"))) {
if (!visibility.EqualsLiteral("visible")) {
return NS_OK;
}

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

@ -1245,7 +1245,7 @@ nsXULElement::GetElementsByTagNameNS(const nsAString& aNamespaceURI,
nsCOMPtr<nsIContentList> list;
if (!aNamespaceURI.Equals(NS_LITERAL_STRING("*"))) {
if (!aNamespaceURI.EqualsLiteral("*")) {
nsContentUtils::GetNSManagerWeakRef()->GetNameSpaceID(aNamespaceURI,
&nameSpaceId);
@ -2653,10 +2653,10 @@ nsXULElement::HandleDOMEvent(nsIPresContext* aPresContext, nsEvent* aEvent,
aEvent->message == NS_XUL_POPUP_HIDDEN || aEvent->message == NS_FORM_SELECTED ||
aEvent->message == NS_XUL_BROADCAST || aEvent->message == NS_XUL_COMMAND_UPDATE ||
aEvent->message == NS_XUL_CLICK || aEvent->message == NS_DRAGDROP_GESTURE ||
tagName == NS_LITERAL_STRING("menu") || tagName == NS_LITERAL_STRING("menuitem") ||
tagName == NS_LITERAL_STRING("menulist") || tagName == NS_LITERAL_STRING("menubar") ||
tagName == NS_LITERAL_STRING("menupopup") || tagName == NS_LITERAL_STRING("key") ||
tagName == NS_LITERAL_STRING("keyset")) {
tagName.EqualsLiteral("menu") || tagName.EqualsLiteral("menuitem") ||
tagName.EqualsLiteral("menulist") || tagName.EqualsLiteral("menubar") ||
tagName.EqualsLiteral("menupopup") || tagName.EqualsLiteral("key") ||
tagName.EqualsLiteral("keyset")) {
nsCOMPtr<nsIEventListenerManager> listenerManager;
if (NS_FAILED(ret = GetListenerManager(getter_AddRefs(listenerManager)))) {
@ -3318,7 +3318,7 @@ nsXULElement::GetHidden(PRBool* aResult)
*aResult = PR_FALSE;
nsAutoString val;
GetAttribute(NS_LITERAL_STRING("hidden"), val);
if (val.Equals(NS_LITERAL_STRING("true")))
if (val.EqualsLiteral("true"))
*aResult = PR_TRUE;
return NS_OK;
}
@ -3339,7 +3339,7 @@ nsXULElement::GetCollapsed(PRBool* aResult)
*aResult = PR_FALSE;
nsAutoString val;
GetAttribute(NS_LITERAL_STRING("collapsed"), val);
if (val.Equals(NS_LITERAL_STRING("true")))
if (val.EqualsLiteral("true"))
*aResult = PR_TRUE;
return NS_OK;
}
@ -3360,7 +3360,7 @@ nsXULElement::GetAllowEvents(PRBool* aResult)
*aResult = PR_FALSE;
nsAutoString val;
GetAttribute(NS_LITERAL_STRING("allowevents"), val);
if (val.Equals(NS_LITERAL_STRING("true")))
if (val.EqualsLiteral("true"))
*aResult = PR_TRUE;
return NS_OK;
}
@ -3719,7 +3719,7 @@ nsXULElement::Click()
{
nsAutoString disabled;
GetAttribute(NS_LITERAL_STRING("disabled"), disabled);
if (disabled == NS_LITERAL_STRING("true"))
if (disabled.EqualsLiteral("true"))
return NS_OK;
nsCOMPtr<nsIDocument> doc = mDocument; // Strong just in case
@ -3785,7 +3785,7 @@ nsXULElement::SetFocus(nsIPresContext* aPresContext)
{
nsAutoString disabled;
GetAttribute(NS_LITERAL_STRING("disabled"), disabled);
if (disabled == NS_LITERAL_STRING("true"))
if (disabled.EqualsLiteral("true"))
return;
aPresContext->EventStateManager()->SetContentState(this,

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

@ -449,43 +449,43 @@ static void ConvertPosition(nsIDOMElement* aPopupElt, nsString& aAnchor, nsStrin
if (position.IsEmpty())
return;
if (position.Equals(NS_LITERAL_STRING("before_start"))) {
if (position.EqualsLiteral("before_start")) {
aAnchor.Assign(NS_LITERAL_STRING("topleft"));
aAlign.Assign(NS_LITERAL_STRING("bottomleft"));
}
else if (position.Equals(NS_LITERAL_STRING("before_end"))) {
else if (position.EqualsLiteral("before_end")) {
aAnchor.Assign(NS_LITERAL_STRING("topright"));
aAlign.Assign(NS_LITERAL_STRING("bottomright"));
}
else if (position.Equals(NS_LITERAL_STRING("after_start"))) {
else if (position.EqualsLiteral("after_start")) {
aAnchor.Assign(NS_LITERAL_STRING("bottomleft"));
aAlign.Assign(NS_LITERAL_STRING("topleft"));
}
else if (position.Equals(NS_LITERAL_STRING("after_end"))) {
else if (position.EqualsLiteral("after_end")) {
aAnchor.Assign(NS_LITERAL_STRING("bottomright"));
aAlign.Assign(NS_LITERAL_STRING("topright"));
}
else if (position.Equals(NS_LITERAL_STRING("start_before"))) {
else if (position.EqualsLiteral("start_before")) {
aAnchor.Assign(NS_LITERAL_STRING("topleft"));
aAlign.Assign(NS_LITERAL_STRING("topright"));
}
else if (position.Equals(NS_LITERAL_STRING("start_after"))) {
else if (position.EqualsLiteral("start_after")) {
aAnchor.Assign(NS_LITERAL_STRING("bottomleft"));
aAlign.Assign(NS_LITERAL_STRING("bottomright"));
}
else if (position.Equals(NS_LITERAL_STRING("end_before"))) {
else if (position.EqualsLiteral("end_before")) {
aAnchor.Assign(NS_LITERAL_STRING("topright"));
aAlign.Assign(NS_LITERAL_STRING("topleft"));
}
else if (position.Equals(NS_LITERAL_STRING("end_after"))) {
else if (position.EqualsLiteral("end_after")) {
aAnchor.Assign(NS_LITERAL_STRING("bottomright"));
aAlign.Assign(NS_LITERAL_STRING("bottomleft"));
}
else if (position.Equals(NS_LITERAL_STRING("overlap"))) {
else if (position.EqualsLiteral("overlap")) {
aAnchor.Assign(NS_LITERAL_STRING("topleft"));
aAlign.Assign(NS_LITERAL_STRING("topleft"));
}
else if (position.Equals(NS_LITERAL_STRING("after_pointer")))
else if (position.EqualsLiteral("after_pointer"))
aY += 21;
}
@ -520,9 +520,9 @@ XULPopupListenerImpl::LaunchPopup(PRInt32 aClientX, PRInt32 aClientY)
mElement->GetAttribute(type, identifier);
if (identifier.IsEmpty()) {
if (type.Equals(NS_LITERAL_STRING("popup")))
if (type.EqualsLiteral("popup"))
mElement->GetAttribute(NS_LITERAL_STRING("menu"), identifier);
else if (type.Equals(NS_LITERAL_STRING("context")))
else if (type.EqualsLiteral("context"))
mElement->GetAttribute(NS_LITERAL_STRING("contextmenu"), identifier);
if (identifier.IsEmpty())
return rv;
@ -542,7 +542,7 @@ XULPopupListenerImpl::LaunchPopup(PRInt32 aClientX, PRInt32 aClientY)
// Handle the _child case for popups and context menus
nsCOMPtr<nsIDOMElement> popupContent;
if (identifier == NS_LITERAL_STRING("_child")) {
if (identifier.EqualsLiteral("_child")) {
nsCOMPtr<nsIContent> popup;
GetImmediateChild(content, nsXULAtoms::menupopup, getter_AddRefs(popup));

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

@ -382,7 +382,7 @@ PRBool
nsXULCommandDispatcher::Matches(const nsString& aList,
const nsAString& aElement)
{
if (aList.Equals(NS_LITERAL_STRING("*")))
if (aList.EqualsLiteral("*"))
return PR_TRUE; // match _everything_!
PRInt32 indx = aList.Find(PromiseFlatString(aElement));

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

@ -1049,7 +1049,7 @@ XULContentSinkImpl::HandleProcessingInstruction(const PRUnichar *aTarget,
nsParserUtils::GetQuotedAttributeValue(data, NS_LITERAL_STRING("alternate"), alternate);
nsresult result = ProcessStyleLink(nsnull /* XXX need a node here */,
href, alternate.Equals(NS_LITERAL_STRING("yes")), /* XXX ignore case? */
href, alternate.EqualsLiteral("yes"), /* XXX ignore case? */
title, type, media);
if (NS_FAILED(result)) {
if (result == NS_ERROR_HTMLPARSER_BLOCK && mParser) {
@ -1387,10 +1387,10 @@ XULContentSinkImpl::OpenScript(const PRUnichar** aAttributes,
nsAutoString src;
while (*aAttributes) {
const nsDependentString key(aAttributes[0]);
if (key.Equals(NS_LITERAL_STRING("src"))) {
if (key.EqualsLiteral("src")) {
src.Assign(aAttributes[1]);
}
else if (key.Equals(NS_LITERAL_STRING("type"))) {
else if (key.EqualsLiteral("type")) {
nsAutoString type(aAttributes[1]);
nsAutoString mimeType;
nsAutoString params;
@ -1416,7 +1416,7 @@ XULContentSinkImpl::OpenScript(const PRUnichar** aAttributes,
jsVersionString = JS_VersionToString(jsVersion);
}
}
else if (key.Equals(NS_LITERAL_STRING("language"))) {
else if (key.EqualsLiteral("language")) {
nsAutoString lang(aAttributes[1]);
isJavaScript = nsParserUtils::IsJavaScriptLanguage(lang, &jsVersionString);
}

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

@ -518,7 +518,7 @@ nsXULDocument::GetContentType(nsAString& aContentType)
void
nsXULDocument::SetContentType(const nsAString& aContentType)
{
NS_ASSERTION(aContentType.Equals(NS_LITERAL_STRING("application/vnd.mozilla.xul+xml")),
NS_ASSERTION(aContentType.EqualsLiteral("application/vnd.mozilla.xul+xml"),
"xul-documents always has content-type application/vnd.mozilla.xul+xml");
// Don't do anything, xul always has the mimetype
// application/vnd.mozilla.xul+xml
@ -828,7 +828,7 @@ nsXULDocument::SynchronizeBroadcastListener(nsIDOMElement *aBroadcaster,
nsCOMPtr<nsIContent> broadcaster = do_QueryInterface(aBroadcaster);
nsCOMPtr<nsIContent> listener = do_QueryInterface(aListener);
if (aAttr.Equals(NS_LITERAL_STRING("*"))) {
if (aAttr.EqualsLiteral("*")) {
PRUint32 count = broadcaster->GetAttrCount();
while (count-- > 0) {
PRInt32 nameSpaceID;
@ -1047,7 +1047,7 @@ nsXULDocument::ExecuteOnBroadcastHandlerFor(nsIContent* aBroadcaster,
listeningToAttribute);
if (!aAttr->Equals(listeningToAttribute) &&
listeningToAttribute != NS_LITERAL_STRING("*")) {
!listeningToAttribute.EqualsLiteral("*")) {
continue;
}
@ -1771,7 +1771,7 @@ nsXULDocument::AddElementToDocumentPre(nsIContent* aElement)
rv = aElement->GetAttr(kNameSpaceID_None, nsXULAtoms::commandupdater,
value);
if (rv == NS_CONTENT_ATTR_HAS_VALUE &&
value == NS_LITERAL_STRING("true")) {
value.EqualsLiteral("true")) {
rv = nsXULContentUtils::SetCommandUpdater(this, aElement);
if (NS_FAILED(rv)) return rv;
}
@ -1888,7 +1888,7 @@ nsXULDocument::RemoveSubtreeFromDocument(nsIContent* aElement)
rv = aElement->GetAttr(kNameSpaceID_None, nsXULAtoms::commandupdater,
value);
if (rv == NS_CONTENT_ATTR_HAS_VALUE &&
value == NS_LITERAL_STRING("true")) {
value.EqualsLiteral("true")) {
nsCOMPtr<nsIDOMElement> domelement = do_QueryInterface(aElement);
NS_ASSERTION(domelement != nsnull, "not a DOM element");
if (! domelement)
@ -2193,7 +2193,7 @@ nsXULDocument::MatchAttribute(nsIContent* aContent,
return PR_FALSE;
}
if (aAttrValue == NS_LITERAL_STRING("*")) {
if (aAttrValue.EqualsLiteral("*")) {
// Wildcard. We already know we have this attr, so we match
return PR_TRUE;
}
@ -3653,7 +3653,7 @@ nsXULDocument::OverlayForwardReference::Merge(nsIContent* aTargetNode,
// Element in the overlay has the 'removeelement' attribute set
// so remove it from the actual document.
if (attr == nsXULAtoms::removeelement &&
value.Equals(NS_LITERAL_STRING("true"))) {
value.EqualsLiteral("true")) {
rv = RemoveElement(aTargetNode->GetParent(), aTargetNode);
if (NS_FAILED(rv)) return rv;

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

@ -526,7 +526,7 @@ nsXULContentBuilder::BuildContentFromTemplate(nsIContent *aTemplateNode,
aMatch->mAssignments.GetAssignmentFor(aMatch->mRule->GetMemberVariable(), &member);
aChild = VALUE_TO_IRDFRESOURCE(member);
}
else if (uri.Equals(NS_LITERAL_STRING("...")) || uri.Equals(NS_LITERAL_STRING("rdf:*"))) {
else if (uri.EqualsLiteral("...") || uri.EqualsLiteral("rdf:*")) {
// If we -are- the resource element, then we are no
// matter unique.
isResourceElement = PR_TRUE;
@ -1371,7 +1371,7 @@ nsXULContentBuilder::IsOpen(nsIContent* aElement)
NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get open attribute");
return (rv == NS_CONTENT_ATTR_HAS_VALUE &&
value == NS_LITERAL_STRING("true"));
value.EqualsLiteral("true"));
}
@ -1616,7 +1616,7 @@ nsXULContentBuilder::AttributeChanged(nsIDocument* aDocument,
nsAutoString open;
aContent->GetAttr(kNameSpaceID_None, nsXULAtoms::open, open);
if (open == NS_LITERAL_STRING("true"))
if (open.EqualsLiteral("true"))
OpenContainer(aContent);
else
CloseContainer(aContent);

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

@ -428,7 +428,7 @@ XULSortServiceImpl::GetSortColumnInfo(nsIContent *tree,
nsXULAtoms::sortActive, value))
&& (rv == NS_CONTENT_ATTR_HAS_VALUE))
{
if (value.Equals(NS_LITERAL_STRING("true")))
if (value.EqualsLiteral("true"))
{
if (NS_SUCCEEDED(rv = tree->GetAttr(kNameSpaceID_None,
nsXULAtoms::sortResource,
@ -448,7 +448,7 @@ XULSortServiceImpl::GetSortColumnInfo(nsIContent *tree,
value)) &&
(rv == NS_CONTENT_ATTR_HAS_VALUE))
{
if (value.Equals(NS_LITERAL_STRING("true")))
if (value.EqualsLiteral("true"))
{
inbetweenSeparatorSort = PR_TRUE;
}
@ -1234,7 +1234,7 @@ XULSortServiceImpl::SortContainer(nsIContent *container, sortPtr sortInfo,
// if it's a container, find its treechildren nodes, and sort those
if (NS_FAILED(rv = parentNode->GetAttr(kNameSpaceID_None, nsXULAtoms::container, value)) ||
(rv != NS_CONTENT_ATTR_HAS_VALUE) || !value.Equals(NS_LITERAL_STRING("true")))
(rv != NS_CONTENT_ATTR_HAS_VALUE) || !value.EqualsLiteral("true"))
continue;
numChildren = parentNode->GetChildCount();
@ -1468,7 +1468,7 @@ XULSortServiceImpl::InsertContainerNode(nsIRDFCompositeDataSource *db, nsRDFSort
}
if (NS_SUCCEEDED(rv = root->GetAttr(kNameSpaceID_None, nsXULAtoms::sortStaticsLast, valueStr))
&& (rv == NS_CONTENT_ATTR_HAS_VALUE) && valueStr.Equals(NS_LITERAL_STRING("true")))
&& (rv == NS_CONTENT_ATTR_HAS_VALUE) && valueStr.EqualsLiteral("true"))
{
// indicate that static XUL comes after RDF-generated content by making negative
staticCount = -staticCount;
@ -1583,7 +1583,7 @@ XULSortServiceImpl::Sort(nsIDOMNode* node, const nsAString& sortResource, const
nsAutoString value;
if (NS_SUCCEEDED(rv = dbNode->GetAttr(kNameSpaceID_None, nsXULAtoms::sortActive, value))
&& (rv == NS_CONTENT_ATTR_HAS_VALUE)
&& value.Equals(NS_LITERAL_STRING("true")))
&& value.EqualsLiteral("true"))
{
if (NS_SUCCEEDED(rv = dbNode->GetAttr(kNameSpaceID_None, nsXULAtoms::sortResource, value))
&& (rv == NS_CONTENT_ATTR_HAS_VALUE)

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

@ -678,12 +678,12 @@ nsXULTemplateBuilder::LoadDataSources(nsIDocument* doc)
// check for magical attributes. XXX move to ``flags''?
nsAutoString coalesce;
mRoot->GetAttr(kNameSpaceID_None, nsXULAtoms::coalesceduplicatearcs, coalesce);
if (coalesce == NS_LITERAL_STRING("false"))
if (coalesce.EqualsLiteral("false"))
mDB->SetCoalesceDuplicateArcs(PR_FALSE);
nsAutoString allowneg;
mRoot->GetAttr(kNameSpaceID_None, nsXULAtoms::allownegativeassertions, allowneg);
if (allowneg == NS_LITERAL_STRING("false"))
if (allowneg.EqualsLiteral("false"))
mDB->SetAllowNegativeAssertions(PR_FALSE);
// Grab the doc's principal...
@ -737,7 +737,7 @@ nsXULTemplateBuilder::LoadDataSources(nsIDocument* doc)
first = last + 1;
// A special 'dummy' datasource
if (uriStr == NS_LITERAL_STRING("rdf:null"))
if (uriStr.EqualsLiteral("rdf:null"))
continue;
// N.B. that `failure' (e.g., because it's an unknown
@ -997,7 +997,7 @@ nsXULTemplateBuilder::SubstituteText(nsTemplateMatch& aMatch,
nsAString& aResult)
{
// See if it's the special value "..."
if (aAttributeValue == NS_LITERAL_STRING("...")) {
if (aAttributeValue.EqualsLiteral("...")) {
Value memberval;
aMatch.GetAssignmentFor(mConflictSet, mMemberVar, &memberval);
@ -1048,7 +1048,7 @@ nsXULTemplateBuilder::SubstituteTextReplaceVariable(nsXULTemplateBuilder* aThis,
// The symbol "rdf:*" is special, and means "this guy's URI"
PRInt32 var = 0;
if (aVariable == NS_LITERAL_STRING("rdf:*"))
if (aVariable.EqualsLiteral("rdf:*"))
var = c->match.mRule->GetMemberVariable();
else
var = aThis->mRules.LookupSymbol(PromiseFlatString(aVariable).get());
@ -2074,10 +2074,10 @@ nsXULTemplateBuilder::CompileSimpleRule(nsIContent* aRuleElement,
if (NS_FAILED(rv)) return rv;
if (rv == NS_CONTENT_ATTR_HAS_VALUE) {
if (value.Equals(NS_LITERAL_STRING("true"))) {
if (value.EqualsLiteral("true")) {
iscontainer = nsRDFConInstanceTestNode::eTrue;
}
else if (value.Equals(NS_LITERAL_STRING("false"))) {
else if (value.EqualsLiteral("false")) {
iscontainer = nsRDFConInstanceTestNode::eFalse;
}
}
@ -2089,10 +2089,10 @@ nsXULTemplateBuilder::CompileSimpleRule(nsIContent* aRuleElement,
if (NS_FAILED(rv)) return rv;
if (rv == NS_CONTENT_ATTR_HAS_VALUE) {
if (value.Equals(NS_LITERAL_STRING("true"))) {
if (value.EqualsLiteral("true")) {
isempty = nsRDFConInstanceTestNode::eTrue;
}
else if (value.Equals(NS_LITERAL_STRING("false"))) {
else if (value.EqualsLiteral("false")) {
isempty = nsRDFConInstanceTestNode::eFalse;
}
}
@ -2129,7 +2129,7 @@ nsXULTemplateBuilder::CompileSimpleRule(nsIContent* aRuleElement,
if (aRuleElement->HasAttr(kNameSpaceID_None, nsXULAtoms::parsetype)) {
nsAutoString parseType;
aRuleElement->GetAttr(kNameSpaceID_None, nsXULAtoms::parsetype, parseType);
if (parseType.Equals(NS_LITERAL_STRING("Integer"))) {
if (parseType.EqualsLiteral("Integer")) {
nsCOMPtr<nsIRDFInt> intLiteral;
PRInt32 errorCode = nsnull;
rv = gRDFService->GetIntLiteral(value.ToInteger(&errorCode), getter_AddRefs(intLiteral));

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

@ -418,7 +418,7 @@ nsXULTreeBuilder::Sort(nsIDOMElement* aElement)
nsAutoString sortLocked;
header->GetAttr(kNameSpaceID_None, nsXULAtoms::sortLocked, sortLocked);
if (sortLocked.Equals(NS_LITERAL_STRING("true")))
if (sortLocked.EqualsLiteral("true"))
return NS_OK;
nsAutoString sort;
@ -434,11 +434,11 @@ nsXULTreeBuilder::Sort(nsIDOMElement* aElement)
nsAutoString dir;
header->GetAttr(kNameSpaceID_None, nsXULAtoms::sortDirection, dir);
if (dir == NS_LITERAL_STRING("ascending")) {
if (dir.EqualsLiteral("ascending")) {
dir = NS_LITERAL_STRING("descending");
mSortDirection = eDirection_Descending;
}
else if (dir == NS_LITERAL_STRING("descending")) {
else if (dir.EqualsLiteral("descending")) {
dir = NS_LITERAL_STRING("natural");
mSortDirection = eDirection_Natural;
}
@ -720,9 +720,9 @@ nsXULTreeBuilder::GetProgressMode(PRInt32 aRow, nsITreeColumn* aCol, PRInt32* aR
nsAutoString mode;
SubstituteText(*(mRows[aRow]->mMatch), raw, mode);
if (mode.Equals(NS_LITERAL_STRING("normal")))
if (mode.EqualsLiteral("normal"))
*aResult = nsITreeView::PROGRESS_NORMAL;
else if (mode.Equals(NS_LITERAL_STRING("undetermined")))
else if (mode.EqualsLiteral("undetermined"))
*aResult = nsITreeView::PROGRESS_UNDETERMINED;
}
@ -967,7 +967,7 @@ nsXULTreeBuilder::IsEditable(PRInt32 aRow, nsITreeColumn* aCol, PRBool* _retval)
nsAutoString editable;
SubstituteText(*(mRows[aRow]->mMatch), raw, editable);
if (editable.Equals(NS_LITERAL_STRING("false")))
if (editable.EqualsLiteral("false"))
*_retval = PR_FALSE;
}
@ -1253,7 +1253,7 @@ nsXULTreeBuilder::EnsureSortVariables()
if (ni && ni->Equals(nsXULAtoms::treecol, kNameSpaceID_XUL)) {
nsAutoString sortActive;
child->GetAttr(kNameSpaceID_None, nsXULAtoms::sortActive, sortActive);
if (sortActive == NS_LITERAL_STRING("true")) {
if (sortActive.EqualsLiteral("true")) {
nsAutoString sort;
child->GetAttr(kNameSpaceID_None, nsXULAtoms::sort, sort);
if (!sort.IsEmpty()) {
@ -1261,9 +1261,9 @@ nsXULTreeBuilder::EnsureSortVariables()
nsAutoString sortDirection;
child->GetAttr(kNameSpaceID_None, nsXULAtoms::sortDirection, sortDirection);
if (sortDirection == NS_LITERAL_STRING("ascending"))
if (sortDirection.EqualsLiteral("ascending"))
mSortDirection = eDirection_Ascending;
else if (sortDirection == NS_LITERAL_STRING("descending"))
else if (sortDirection.EqualsLiteral("descending"))
mSortDirection = eDirection_Descending;
else
mSortDirection = eDirection_Natural;

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

@ -1041,7 +1041,7 @@ nsresult nsDocShell::FindTarget(const PRUnichar *aWindowTarget,
}
// _main is an IE target which should be case-insensitive but isn't
// see bug 217886 for details
else if(name.EqualsIgnoreCase("_content") || name.Equals(NS_LITERAL_STRING("_main")))
else if(name.EqualsIgnoreCase("_content") || name.EqualsLiteral("_main"))
{
if (mTreeOwner) {
mTreeOwner->FindItemWithName(name.get(), nsnull,
@ -5052,7 +5052,7 @@ nsDocShell::InternalLoad(nsIURI * aURI,
// _main is an IE target which should be case-insensitive but isn't
// see bug 217886 for details
if (!bIsJavascript &&
(name.EqualsIgnoreCase("_content") || name.Equals(NS_LITERAL_STRING("_main")) ||
(name.EqualsIgnoreCase("_content") || name.EqualsLiteral("_main") ||
name.EqualsIgnoreCase("_blank")))
{
nsCOMPtr<nsIExternalProtocolService> extProtService;
@ -5098,7 +5098,7 @@ nsDocShell::InternalLoad(nsIURI * aURI,
else if (!name.EqualsIgnoreCase("_parent") &&
!name.EqualsIgnoreCase("_self") &&
!name.EqualsIgnoreCase("_content") &&
!name.Equals(NS_LITERAL_STRING("_main"))) {
!name.EqualsLiteral("_main")) {
nsCOMPtr<nsIDocShellTreeItem> targetTreeItem;
FindItemWithName(name.get(),
NS_STATIC_CAST(nsIInterfaceRequestor *, this),

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

@ -558,7 +558,7 @@ GlobalWindowImpl::SetNewDocument(nsIDOMDocument* aDocument,
nsCAutoString url;
docURL->GetSpec(url);
PRBool isAboutBlank = url.Equals(NS_LITERAL_CSTRING("about:blank"));
PRBool isAboutBlank = url.EqualsLiteral("about:blank");
PRBool isSameOrigin = PR_FALSE;
if (isAboutBlank && mOpenerScriptURL) {
@ -3105,7 +3105,7 @@ PRBool GlobalWindowImpl::CheckOpenAllow(PRUint32 aAbuseLevel,
if (name.EqualsIgnoreCase("_top") ||
name.EqualsIgnoreCase("_self") ||
name.EqualsIgnoreCase("_content") ||
name.Equals(NS_LITERAL_STRING("_main")))
name.EqualsLiteral("_main"))
allowWindow = PR_TRUE;
else {
nsCOMPtr<nsIWindowWatcher> wwatch =

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

@ -99,8 +99,8 @@ nsJSEventListener::HandleEvent(nsIDOMEvent* aEvent)
return NS_OK;
}
//if (mReturnResult == nsReturnResult_eNotSet) {
if (eventString.Equals(NS_LITERAL_STRING("error")) ||
eventString.Equals(NS_LITERAL_STRING("mouseover"))) {
if (eventString.EqualsLiteral("error") ||
eventString.EqualsLiteral("mouseover")) {
mReturnResult = nsReturnResult_eReverseReturnResult;
}
else {
@ -138,7 +138,7 @@ nsJSEventListener::HandleEvent(nsIDOMEvent* aEvent)
}
PRBool handledScriptError = PR_FALSE;
if (eventString.Equals(NS_LITERAL_STRING("onerror"))) {
if (eventString.EqualsLiteral("onerror")) {
nsCOMPtr<nsIPrivateDOMEvent> priv(do_QueryInterface(aEvent));
NS_ENSURE_TRUE(priv, NS_ERROR_UNEXPECTED);
@ -178,7 +178,7 @@ nsJSEventListener::HandleEvent(nsIDOMEvent* aEvent)
}
if (NS_SUCCEEDED(rv)) {
if (eventString.Equals(NS_LITERAL_STRING("onbeforeunload"))) {
if (eventString.EqualsLiteral("onbeforeunload")) {
nsCOMPtr<nsIPrivateDOMEvent> priv(do_QueryInterface(aEvent));
NS_ENSURE_TRUE(priv, NS_ERROR_UNEXPECTED);

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

@ -259,8 +259,8 @@ nsStyleUpdatingCommand::ToggleState(nsIEditor *aEditor, const char* aTagName)
// they are used to remove named anchor/link and shouldn't be used for insertion
nsAutoString tagName; tagName.AssignWithConversion(aTagName);
PRBool doTagRemoval;
if (tagName.Equals(NS_LITERAL_STRING("href")) ||
tagName.Equals(NS_LITERAL_STRING("name")))
if (tagName.EqualsLiteral("href") ||
tagName.EqualsLiteral("name"))
doTagRemoval = PR_TRUE;
else
{
@ -281,12 +281,12 @@ nsStyleUpdatingCommand::ToggleState(nsIEditor *aEditor, const char* aTagName)
nsAutoString removeName;
aEditor->BeginTransaction();
if (tagName.Equals(NS_LITERAL_STRING("sub")))
if (tagName.EqualsLiteral("sub"))
{
removeName.AssignWithConversion("sup");
rv = RemoveTextProperty(aEditor,tagName.get(), nsnull);
}
else if (tagName.Equals(NS_LITERAL_STRING("sup")))
else if (tagName.EqualsLiteral("sup"))
{
removeName.AssignWithConversion("sub");
rv = RemoveTextProperty(aEditor, tagName.get(), nsnull);
@ -765,7 +765,7 @@ nsFontFaceStateCommand::SetState(nsIEditor *aEditor, nsString& newState)
nsCOMPtr<nsIAtom> ttAtom = do_GetAtom("tt");
nsCOMPtr<nsIAtom> fontAtom = do_GetAtom("font");
if (newState.Equals(NS_LITERAL_STRING("tt")))
if (newState.EqualsLiteral("tt"))
{
// The old "teletype" attribute
rv = htmlEditor->SetInlineProperty(ttAtom, EmptyString(),
@ -778,7 +778,7 @@ nsFontFaceStateCommand::SetState(nsIEditor *aEditor, nsString& newState)
// Remove any existing TT nodes
rv = htmlEditor->RemoveInlineProperty(ttAtom, EmptyString());
if (newState.IsEmpty() || newState.Equals(NS_LITERAL_STRING("normal"))) {
if (newState.IsEmpty() || newState.EqualsLiteral("normal")) {
rv = htmlEditor->RemoveInlineProperty(fontAtom, NS_LITERAL_STRING("face"));
} else {
rv = htmlEditor->SetInlineProperty(fontAtom, NS_LITERAL_STRING("face"),
@ -847,8 +847,8 @@ nsFontSizeStateCommand::SetState(nsIEditor *aEditor, nsString& newState)
nsresult rv;
nsCOMPtr<nsIAtom> fontAtom = do_GetAtom("font");
if (newState.IsEmpty() ||
newState.Equals(NS_LITERAL_STRING("normal")) ||
newState.Equals(NS_LITERAL_STRING("medium"))) {
newState.EqualsLiteral("normal") ||
newState.EqualsLiteral("medium")) {
// remove any existing font size, big or small
rv = htmlEditor->RemoveInlineProperty(fontAtom, NS_LITERAL_STRING("size"));
if (NS_FAILED(rv)) return rv;
@ -909,7 +909,7 @@ nsFontColorStateCommand::SetState(nsIEditor *aEditor, nsString& newState)
nsresult rv;
nsCOMPtr<nsIAtom> fontAtom = do_GetAtom("font");
if (newState.IsEmpty() || newState.Equals(NS_LITERAL_STRING("normal"))) {
if (newState.IsEmpty() || newState.EqualsLiteral("normal")) {
rv = htmlEditor->RemoveInlineProperty(fontAtom, NS_LITERAL_STRING("color"));
} else {
rv = htmlEditor->SetInlineProperty(fontAtom, NS_LITERAL_STRING("color"),
@ -959,7 +959,7 @@ nsHighlightColorStateCommand::SetState(nsIEditor *aEditor, nsString& newState)
nsresult rv;
nsCOMPtr<nsIAtom> fontAtom = do_GetAtom("font");
if (newState.IsEmpty() || newState.Equals(NS_LITERAL_STRING("normal"))) {
if (newState.IsEmpty() || newState.EqualsLiteral("normal")) {
// rv = RemoveOneProperty(htmlEditor, NS_LITERAL_STRING("font"), NS_LITERAL_STRING("bgcolor"));
rv = htmlEditor->RemoveInlineProperty(fontAtom, NS_LITERAL_STRING("bgcolor"));
} else {
@ -1676,7 +1676,7 @@ RemoveTextProperty(nsIEditor *aEditor, const PRUnichar *prop,
nsAutoString allStr(prop);
ToLowerCase(allStr);
PRBool doingAll = (allStr.Equals(NS_LITERAL_STRING("all")));
PRBool doingAll = (allStr.EqualsLiteral("all"));
nsresult err = NS_OK;
if (doingAll)

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

@ -311,13 +311,13 @@ nsComposerCommandsUpdater::UpdateCommandGroup(const nsAString& aCommandGroup)
// This hardcoded list of commands is temporary.
// This code should use nsIControllerCommandGroup.
if (aCommandGroup.Equals(NS_LITERAL_STRING("undo")))
if (aCommandGroup.EqualsLiteral("undo"))
{
commandUpdater->CommandStatusChanged("cmd_undo");
commandUpdater->CommandStatusChanged("cmd_redo");
}
else if (aCommandGroup.Equals(NS_LITERAL_STRING("select")) ||
aCommandGroup.Equals(NS_LITERAL_STRING("style")))
else if (aCommandGroup.EqualsLiteral("select") ||
aCommandGroup.EqualsLiteral("style"))
{
commandUpdater->CommandStatusChanged("cmd_bold");
commandUpdater->CommandStatusChanged("cmd_italic");
@ -347,7 +347,7 @@ nsComposerCommandsUpdater::UpdateCommandGroup(const nsAString& aCommandGroup)
commandUpdater->CommandStatusChanged("cmd_backgroundColor");
commandUpdater->CommandStatusChanged("cmd_highlight");
}
else if (aCommandGroup.Equals(NS_LITERAL_STRING("save")))
else if (aCommandGroup.EqualsLiteral("save"))
{
// save commands (most are not in C++)
commandUpdater->CommandStatusChanged("cmd_setDocumentModified");

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

@ -319,7 +319,7 @@ nsEditingSession::SetupEditorOnWindow(nsIDOMWindow *aWindow)
mEditorType = NS_LITERAL_CSTRING("text");
mimeCType = "text/plain";
}
else if (!mimeCType.Equals(NS_LITERAL_CSTRING("text/html")))
else if (!mimeCType.EqualsLiteral("text/html"))
{
// Neither an acceptable text or html type.
mEditorStatus = eEditorErrorCantEditMimeType;
@ -333,20 +333,20 @@ nsEditingSession::SetupEditorOnWindow(nsIDOMWindow *aWindow)
PRBool needHTMLController = PR_FALSE;
const char *classString = "@mozilla.org/editor/htmleditor;1";
if (mEditorType.Equals(NS_LITERAL_CSTRING("textmail")))
if (mEditorType.EqualsLiteral("textmail"))
{
mEditorFlags = nsIPlaintextEditor::eEditorPlaintextMask |
nsIPlaintextEditor::eEditorEnableWrapHackMask |
nsIPlaintextEditor::eEditorMailMask;
}
else if (mEditorType.Equals(NS_LITERAL_CSTRING("text")))
else if (mEditorType.EqualsLiteral("text"))
{
mEditorFlags = nsIPlaintextEditor::eEditorPlaintextMask |
nsIPlaintextEditor::eEditorEnableWrapHackMask;
}
else if (mEditorType.Equals(NS_LITERAL_CSTRING("htmlmail")))
else if (mEditorType.EqualsLiteral("htmlmail"))
{
if (mimeCType.Equals(NS_LITERAL_CSTRING("text/html")))
if (mimeCType.EqualsLiteral("text/html"))
{
needHTMLController = PR_TRUE;
mEditorFlags = nsIPlaintextEditor::eEditorMailMask;

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

@ -111,7 +111,7 @@ nsHTMLEditor::GetAbsolutelyPositionedSelectionContainer(nsIDOMElement **_retval)
res = mHTMLCSSUtils->GetComputedProperty(node, nsEditProperty::cssPosition,
positionStr);
if (NS_FAILED(res)) return res;
if (positionStr.Equals(NS_LITERAL_STRING("absolute")))
if (positionStr.EqualsLiteral("absolute"))
resultNode = node;
else {
nsCOMPtr<nsIDOMNode> parentNode;
@ -222,7 +222,7 @@ nsHTMLEditor::GetElementZIndex(nsIDOMElement * aElement,
nsEditProperty::cssZIndex,
zIndexStr);
if (NS_FAILED(res)) return res;
if (zIndexStr.Equals(NS_LITERAL_STRING("auto"))) {
if (zIndexStr.EqualsLiteral("auto")) {
// we have to look at the positioned ancestors
// cf. CSS 2 spec section 9.9.1
nsCOMPtr<nsIDOMNode> parentNode;
@ -231,13 +231,13 @@ nsHTMLEditor::GetElementZIndex(nsIDOMElement * aElement,
nsCOMPtr<nsIDOMNode> node = parentNode;
nsAutoString positionStr;
while (node &&
zIndexStr.Equals(NS_LITERAL_STRING("auto")) &&
zIndexStr.EqualsLiteral("auto") &&
!nsTextEditUtils::IsBody(node)) {
res = mHTMLCSSUtils->GetComputedProperty(node,
nsEditProperty::cssPosition,
positionStr);
if (NS_FAILED(res)) return res;
if (positionStr.Equals(NS_LITERAL_STRING("absolute"))) {
if (positionStr.EqualsLiteral("absolute")) {
// ah, we found one, what's its z-index ? If its z-index is auto,
// we have to continue climbing the document's tree
res = mHTMLCSSUtils->GetComputedProperty(node,
@ -251,7 +251,7 @@ nsHTMLEditor::GetElementZIndex(nsIDOMElement * aElement,
}
}
if (!zIndexStr.Equals(NS_LITERAL_STRING("auto"))) {
if (!zIndexStr.EqualsLiteral("auto")) {
PRInt32 errorCode;
*aZindex = zIndexStr.ToInteger(&errorCode);
}
@ -524,7 +524,7 @@ nsHTMLEditor::AbsolutelyPositionElement(nsIDOMElement * aElement,
nsAutoString positionStr;
mHTMLCSSUtils->GetComputedProperty(aElement, nsEditProperty::cssPosition,
positionStr);
PRBool isPositioned = (positionStr.Equals(NS_LITERAL_STRING("absolute")));
PRBool isPositioned = (positionStr.EqualsLiteral("absolute"));
// nothing to do if the element is already in the state we want
if (isPositioned == aEnabled)
@ -681,14 +681,14 @@ nsHTMLEditor::CheckPositionedElementBGandFG(nsIDOMElement * aElement,
nsEditProperty::cssBackgroundImage,
bgImageStr);
if (NS_FAILED(res)) return res;
if (bgImageStr.Equals(NS_LITERAL_STRING("none"))) {
if (bgImageStr.EqualsLiteral("none")) {
nsAutoString bgColorStr;
res =
mHTMLCSSUtils->GetComputedProperty(aElement,
nsEditProperty::cssBackgroundColor,
bgColorStr);
if (NS_FAILED(res)) return res;
if (bgColorStr.Equals(NS_LITERAL_STRING("transparent"))) {
if (bgColorStr.EqualsLiteral("transparent")) {
nsCOMPtr<nsIDOMViewCSS> viewCSS;
res = mHTMLCSSUtils->GetDefaultViewCSS(aElement, getter_AddRefs(viewCSS));

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

@ -87,11 +87,11 @@ static PRInt32 GetCSSFloatValue(nsIDOMCSSStyleDeclaration * aDecl,
// numeric values
nsAutoString str;
res = val->GetStringValue(str);
if (str.Equals(NS_LITERAL_STRING("thin")))
if (str.EqualsLiteral("thin"))
f = 1;
if (str.Equals(NS_LITERAL_STRING("medium")))
if (str.EqualsLiteral("medium"))
f = 3;
if (str.Equals(NS_LITERAL_STRING("thick")))
if (str.EqualsLiteral("thick"))
f = 5;
break;
}
@ -332,7 +332,7 @@ nsHTMLEditor::GetPositionAndDimensions(nsIDOMElement * aElement,
nsAutoString positionStr;
mHTMLCSSUtils->GetComputedProperty(aElement, nsEditProperty::cssPosition,
positionStr);
isPositioned = positionStr.Equals(NS_LITERAL_STRING("absolute"));
isPositioned = positionStr.EqualsLiteral("absolute");
}
if (isPositioned) {

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

@ -62,7 +62,7 @@ void ProcessBValue(const nsAString * aInputString, nsAString & aOutputString,
const char * aDefaultValueString,
const char * aPrependString, const char* aAppendString)
{
if (aInputString && aInputString->Equals(NS_LITERAL_STRING("-moz-editor-invert-value"))) {
if (aInputString && aInputString->EqualsLiteral("-moz-editor-invert-value")) {
aOutputString.Assign(NS_LITERAL_STRING("normal"));
}
else {
@ -128,24 +128,24 @@ void ProcessListStyleTypeValue(const nsAString * aInputString, nsAString & aOutp
{
aOutputString.Truncate();
if (aInputString) {
if (aInputString->Equals(NS_LITERAL_STRING("1"))) {
if (aInputString->EqualsLiteral("1")) {
aOutputString.Append(NS_LITERAL_STRING("decimal"));
}
else if (aInputString->Equals(NS_LITERAL_STRING("a"))) {
else if (aInputString->EqualsLiteral("a")) {
aOutputString.Append(NS_LITERAL_STRING("lower-alpha"));
}
else if (aInputString->Equals(NS_LITERAL_STRING("A"))) {
else if (aInputString->EqualsLiteral("A")) {
aOutputString.Append(NS_LITERAL_STRING("upper-alpha"));
}
else if (aInputString->Equals(NS_LITERAL_STRING("i"))) {
else if (aInputString->EqualsLiteral("i")) {
aOutputString.Append(NS_LITERAL_STRING("lower-roman"));
}
else if (aInputString->Equals(NS_LITERAL_STRING("I"))) {
else if (aInputString->EqualsLiteral("I")) {
aOutputString.Append(NS_LITERAL_STRING("upper-roman"));
}
else if (aInputString->Equals(NS_LITERAL_STRING("square"))
|| aInputString->Equals(NS_LITERAL_STRING("circle"))
|| aInputString->Equals(NS_LITERAL_STRING("disc"))) {
else if (aInputString->EqualsLiteral("square")
|| aInputString->EqualsLiteral("circle")
|| aInputString->EqualsLiteral("disc")) {
aOutputString.Append(*aInputString);
}
}
@ -158,12 +158,12 @@ void ProcessMarginLeftValue(const nsAString * aInputString, nsAString & aOutputS
{
aOutputString.Truncate();
if (aInputString) {
if (aInputString->Equals(NS_LITERAL_STRING("center")) ||
aInputString->Equals(NS_LITERAL_STRING("-moz-center"))) {
if (aInputString->EqualsLiteral("center") ||
aInputString->EqualsLiteral("-moz-center")) {
aOutputString.Append(NS_LITERAL_STRING("auto"));
}
else if (aInputString->Equals(NS_LITERAL_STRING("right")) ||
aInputString->Equals(NS_LITERAL_STRING("-moz-right"))) {
else if (aInputString->EqualsLiteral("right") ||
aInputString->EqualsLiteral("-moz-right")) {
aOutputString.Append(NS_LITERAL_STRING("auto"));
}
else {
@ -179,12 +179,12 @@ void ProcessMarginRightValue(const nsAString * aInputString, nsAString & aOutput
{
aOutputString.Truncate();
if (aInputString) {
if (aInputString->Equals(NS_LITERAL_STRING("center")) ||
aInputString->Equals(NS_LITERAL_STRING("-moz-center"))) {
if (aInputString->EqualsLiteral("center") ||
aInputString->EqualsLiteral("-moz-center")) {
aOutputString.Append(NS_LITERAL_STRING("auto"));
}
else if (aInputString->Equals(NS_LITERAL_STRING("left")) ||
aInputString->Equals(NS_LITERAL_STRING("-moz-left"))) {
else if (aInputString->EqualsLiteral("left") ||
aInputString->EqualsLiteral("-moz-left")) {
aOutputString.Append(NS_LITERAL_STRING("auto"));
}
else {
@ -349,13 +349,13 @@ nsHTMLCSSUtils::IsCSSEditableProperty(nsIDOMNode * aNode,
|| nsEditProperty::u == aProperty
|| nsEditProperty::strike == aProperty
|| ((nsEditProperty::font == aProperty) && aAttribute &&
(aAttribute->Equals(NS_LITERAL_STRING("color")) ||
aAttribute->Equals(NS_LITERAL_STRING("face"))))) {
(aAttribute->EqualsLiteral("color") ||
aAttribute->EqualsLiteral("face")))) {
return PR_TRUE;
}
// ALIGN attribute on elements supporting it
if (aAttribute && (aAttribute->Equals(NS_LITERAL_STRING("align"))) &&
if (aAttribute && (aAttribute->EqualsLiteral("align")) &&
(nsEditProperty::div == tagName
|| nsEditProperty::p == tagName
|| nsEditProperty::h1 == tagName
@ -377,7 +377,7 @@ nsHTMLCSSUtils::IsCSSEditableProperty(nsIDOMNode * aNode,
return PR_TRUE;
}
if (aAttribute && (aAttribute->Equals(NS_LITERAL_STRING("valign"))) &&
if (aAttribute && (aAttribute->EqualsLiteral("valign")) &&
(nsEditProperty::col == tagName
|| nsEditProperty::colgroup == tagName
|| nsEditProperty::tbody == tagName
@ -391,37 +391,37 @@ nsHTMLCSSUtils::IsCSSEditableProperty(nsIDOMNode * aNode,
// attributes TEXT, BACKGROUND and BGCOLOR on BODY
if (aAttribute && (nsEditProperty::body == tagName) &&
(aAttribute->Equals(NS_LITERAL_STRING("text"))
|| aAttribute->Equals(NS_LITERAL_STRING("background"))
|| aAttribute->Equals(NS_LITERAL_STRING("bgcolor")))) {
(aAttribute->EqualsLiteral("text")
|| aAttribute->EqualsLiteral("background")
|| aAttribute->EqualsLiteral("bgcolor"))) {
return PR_TRUE;
}
// attribute BGCOLOR on other elements
if (aAttribute && aAttribute->Equals(NS_LITERAL_STRING("bgcolor"))) {
if (aAttribute && aAttribute->EqualsLiteral("bgcolor")) {
return PR_TRUE;
}
// attributes HEIGHT, WIDTH and NOWRAP on TD and TH
if (aAttribute && ((nsEditProperty::td == tagName)
|| (nsEditProperty::th == tagName)) &&
(aAttribute->Equals(NS_LITERAL_STRING("height"))
|| aAttribute->Equals(NS_LITERAL_STRING("width"))
|| aAttribute->Equals(NS_LITERAL_STRING("nowrap")))) {
(aAttribute->EqualsLiteral("height")
|| aAttribute->EqualsLiteral("width")
|| aAttribute->EqualsLiteral("nowrap"))) {
return PR_TRUE;
}
// attributes HEIGHT and WIDTH on TABLE
if (aAttribute && (nsEditProperty::table == tagName) &&
(aAttribute->Equals(NS_LITERAL_STRING("height"))
|| aAttribute->Equals(NS_LITERAL_STRING("width")))) {
(aAttribute->EqualsLiteral("height")
|| aAttribute->EqualsLiteral("width"))) {
return PR_TRUE;
}
// attributes SIZE and WIDTH on HR
if (aAttribute && (nsEditProperty::hr == tagName) &&
(aAttribute->Equals(NS_LITERAL_STRING("size"))
|| aAttribute->Equals(NS_LITERAL_STRING("width")))) {
(aAttribute->EqualsLiteral("size")
|| aAttribute->EqualsLiteral("width"))) {
return PR_TRUE;
}
@ -429,20 +429,20 @@ nsHTMLCSSUtils::IsCSSEditableProperty(nsIDOMNode * aNode,
if (aAttribute && (nsEditProperty::ol == tagName
|| nsEditProperty::ul == tagName
|| nsEditProperty::li == tagName) &&
aAttribute->Equals(NS_LITERAL_STRING("type"))) {
aAttribute->EqualsLiteral("type")) {
return PR_TRUE;
}
if (aAttribute && nsEditProperty::img == tagName &&
(aAttribute->Equals(NS_LITERAL_STRING("border"))
|| aAttribute->Equals(NS_LITERAL_STRING("width"))
|| aAttribute->Equals(NS_LITERAL_STRING("height")))) {
(aAttribute->EqualsLiteral("border")
|| aAttribute->EqualsLiteral("width")
|| aAttribute->EqualsLiteral("height"))) {
return PR_TRUE;
}
// other elements that we can align using CSS even if they
// can't carry the html ALIGN attribute
if (aAttribute && aAttribute->Equals(NS_LITERAL_STRING("align")) &&
if (aAttribute && aAttribute->EqualsLiteral("align") &&
(nsEditProperty::ul == tagName
|| nsEditProperty::ol == tagName
|| nsEditProperty::dl == tagName
@ -665,7 +665,7 @@ nsHTMLCSSUtils::RemoveCSSInlineStyle(nsIDOMNode *aNode, nsIAtom *aProperty, cons
if (NS_FAILED(res)) return res;
nsAutoString attrString, tmp;
attrName->ToString(attrString);
if (attrString.Equals(NS_LITERAL_STRING("_moz_dirty"))) {
if (attrString.EqualsLiteral("_moz_dirty")) {
res = mHTMLEditor->RemoveContainer(aNode);
if (NS_FAILED(res)) return res;
}
@ -931,26 +931,26 @@ nsHTMLCSSUtils::GenerateCSSDeclarationsFromHTMLStyle(nsIDOMNode * aNode,
}
else if (aAttribute) {
if (nsEditProperty::font == aHTMLProperty &&
aAttribute->Equals(NS_LITERAL_STRING("color"))) {
aAttribute->EqualsLiteral("color")) {
BuildCSSDeclarations(cssPropertyArray, cssValueArray, fontColorEquivTable, aValue, aGetOrRemoveRequest);
}
else if (nsEditProperty::font == aHTMLProperty &&
aAttribute->Equals(NS_LITERAL_STRING("face"))) {
aAttribute->EqualsLiteral("face")) {
BuildCSSDeclarations(cssPropertyArray, cssValueArray, fontFaceEquivTable, aValue, aGetOrRemoveRequest);
}
else if (aAttribute->Equals(NS_LITERAL_STRING("bgcolor"))) {
else if (aAttribute->EqualsLiteral("bgcolor")) {
BuildCSSDeclarations(cssPropertyArray, cssValueArray, bgcolorEquivTable, aValue, aGetOrRemoveRequest);
}
else if (aAttribute->Equals(NS_LITERAL_STRING("background"))) {
else if (aAttribute->EqualsLiteral("background")) {
BuildCSSDeclarations(cssPropertyArray, cssValueArray, backgroundImageEquivTable, aValue, aGetOrRemoveRequest);
}
else if (aAttribute->Equals(NS_LITERAL_STRING("text"))) {
else if (aAttribute->EqualsLiteral("text")) {
BuildCSSDeclarations(cssPropertyArray, cssValueArray, textColorEquivTable, aValue, aGetOrRemoveRequest);
}
else if (aAttribute->Equals(NS_LITERAL_STRING("border"))) {
else if (aAttribute->EqualsLiteral("border")) {
BuildCSSDeclarations(cssPropertyArray, cssValueArray, borderEquivTable, aValue, aGetOrRemoveRequest);
}
else if (aAttribute->Equals(NS_LITERAL_STRING("align"))) {
else if (aAttribute->EqualsLiteral("align")) {
if (nsEditProperty::table == tagName) {
BuildCSSDeclarations(cssPropertyArray, cssValueArray, tableAlignEquivTable, aValue, aGetOrRemoveRequest);
}
@ -965,20 +965,20 @@ nsHTMLCSSUtils::GenerateCSSDeclarationsFromHTMLStyle(nsIDOMNode * aNode,
BuildCSSDeclarations(cssPropertyArray, cssValueArray, textAlignEquivTable, aValue, aGetOrRemoveRequest);
}
}
else if (aAttribute->Equals(NS_LITERAL_STRING("valign"))) {
else if (aAttribute->EqualsLiteral("valign")) {
BuildCSSDeclarations(cssPropertyArray, cssValueArray, verticalAlignEquivTable, aValue, aGetOrRemoveRequest);
}
else if (aAttribute->Equals(NS_LITERAL_STRING("nowrap"))) {
else if (aAttribute->EqualsLiteral("nowrap")) {
BuildCSSDeclarations(cssPropertyArray, cssValueArray, nowrapEquivTable, aValue, aGetOrRemoveRequest);
}
else if (aAttribute->Equals(NS_LITERAL_STRING("width"))) {
else if (aAttribute->EqualsLiteral("width")) {
BuildCSSDeclarations(cssPropertyArray, cssValueArray, widthEquivTable, aValue, aGetOrRemoveRequest);
}
else if (aAttribute->Equals(NS_LITERAL_STRING("height")) ||
(nsEditProperty::hr == tagName && aAttribute->Equals(NS_LITERAL_STRING("size")))) {
else if (aAttribute->EqualsLiteral("height") ||
(nsEditProperty::hr == tagName && aAttribute->EqualsLiteral("size"))) {
BuildCSSDeclarations(cssPropertyArray, cssValueArray, heightEquivTable, aValue, aGetOrRemoveRequest);
}
else if (aAttribute->Equals(NS_LITERAL_STRING("type")) &&
else if (aAttribute->EqualsLiteral("type") &&
(nsEditProperty::ol == tagName
|| nsEditProperty::ul == tagName
|| nsEditProperty::li == tagName)) {
@ -1159,10 +1159,10 @@ nsHTMLCSSUtils::IsCSSEquivalentToHTMLInlineStyleSet(nsIDOMNode * aNode,
if (valueString.Equals(boldStr)) {
aIsSet = PR_TRUE;
}
else if (valueString.Equals(NS_LITERAL_STRING("normal"))) {
else if (valueString.EqualsLiteral("normal")) {
aIsSet = PR_FALSE;
}
else if (valueString.Equals(NS_LITERAL_STRING("bolder"))) {
else if (valueString.EqualsLiteral("bolder")) {
aIsSet = PR_TRUE;
valueString.Assign(boldStr);
}
@ -1183,8 +1183,8 @@ nsHTMLCSSUtils::IsCSSEquivalentToHTMLInlineStyleSet(nsIDOMNode * aNode,
}
else if (nsEditProperty::i == aHTMLProperty) {
if (valueString.Equals(NS_LITERAL_STRING("italic")) ||
valueString.Equals(NS_LITERAL_STRING("oblique"))) {
if (valueString.EqualsLiteral("italic") ||
valueString.EqualsLiteral("oblique")) {
aIsSet= PR_TRUE;
}
}
@ -1203,8 +1203,8 @@ nsHTMLCSSUtils::IsCSSEquivalentToHTMLInlineStyleSet(nsIDOMNode * aNode,
else if (aHTMLAttribute &&
( (nsEditProperty::font == aHTMLProperty &&
aHTMLAttribute->Equals(NS_LITERAL_STRING("color"))) ||
aHTMLAttribute->Equals(NS_LITERAL_STRING("bgcolor")))) {
aHTMLAttribute->EqualsLiteral("color")) ||
aHTMLAttribute->EqualsLiteral("bgcolor"))) {
if (htmlValueString.IsEmpty())
aIsSet = PR_TRUE;
else {
@ -1244,7 +1244,7 @@ nsHTMLCSSUtils::IsCSSEquivalentToHTMLInlineStyleSet(nsIDOMNode * aNode,
}
else if ((nsEditProperty::font == aHTMLProperty) && aHTMLAttribute
&& aHTMLAttribute->Equals(NS_LITERAL_STRING("face"))) {
&& aHTMLAttribute->EqualsLiteral("face")) {
if (!htmlValueString.IsEmpty()) {
const PRUnichar commaSpace[] = { PRUnichar(','), PRUnichar(' '), 0 };
const PRUnichar comma[] = { PRUnichar(','), 0 };
@ -1258,13 +1258,13 @@ nsHTMLCSSUtils::IsCSSEquivalentToHTMLInlineStyleSet(nsIDOMNode * aNode,
// ignore this, it's TT or our default
nsAutoString valueStringLower;
ToLowerCase(valueString, valueStringLower);
aIsSet = !valueStringLower.Equals(NS_LITERAL_STRING("monospace")) &&
!valueStringLower.Equals(NS_LITERAL_STRING("serif"));
aIsSet = !valueStringLower.EqualsLiteral("monospace") &&
!valueStringLower.EqualsLiteral("serif");
}
return NS_OK;
}
else if (aHTMLAttribute
&& aHTMLAttribute->Equals(NS_LITERAL_STRING("align"))) {
&& aHTMLAttribute->EqualsLiteral("align")) {
aIsSet = PR_TRUE;
}
else {

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

@ -851,21 +851,21 @@ nsHTMLEditRules::GetAlignment(PRBool *aMixed, nsIHTMLEditor::EAlignment *aAlign)
&typeAttrName,
value,
COMPUTED_STYLE_TYPE);
if (value.Equals(NS_LITERAL_STRING("center")) ||
value.Equals(NS_LITERAL_STRING("-moz-center")) ||
value.Equals(NS_LITERAL_STRING("auto auto")))
if (value.EqualsLiteral("center") ||
value.EqualsLiteral("-moz-center") ||
value.EqualsLiteral("auto auto"))
{
*aAlign = nsIHTMLEditor::eCenter;
return NS_OK;
}
if (value.Equals(NS_LITERAL_STRING("right")) ||
value.Equals(NS_LITERAL_STRING("-moz-right")) ||
value.Equals(NS_LITERAL_STRING("auto 0px")))
if (value.EqualsLiteral("right") ||
value.EqualsLiteral("-moz-right") ||
value.EqualsLiteral("auto 0px"))
{
*aAlign = nsIHTMLEditor::eRight;
return NS_OK;
}
if (value.Equals(NS_LITERAL_STRING("justify")))
if (value.EqualsLiteral("justify"))
{
*aAlign = nsIHTMLEditor::eJustify;
return NS_OK;
@ -898,11 +898,11 @@ nsHTMLEditRules::GetAlignment(PRBool *aMixed, nsIHTMLEditor::EAlignment *aAlign)
ToLowerCase(typeAttrVal);
if (NS_SUCCEEDED(res) && typeAttrVal.Length())
{
if (typeAttrVal.Equals(NS_LITERAL_STRING("center")))
if (typeAttrVal.EqualsLiteral("center"))
*aAlign = nsIHTMLEditor::eCenter;
else if (typeAttrVal.Equals(NS_LITERAL_STRING("right")))
else if (typeAttrVal.EqualsLiteral("right"))
*aAlign = nsIHTMLEditor::eRight;
else if (typeAttrVal.Equals(NS_LITERAL_STRING("justify")))
else if (typeAttrVal.EqualsLiteral("justify"))
*aAlign = nsIHTMLEditor::eJustify;
else
*aAlign = nsIHTMLEditor::eLeft;
@ -1122,7 +1122,7 @@ nsHTMLEditRules::GetParagraphState(PRBool *aMixed, nsAString &outFormat)
}
// if this is the first node, we've found, remember it as the format
if (formatStr.Equals(NS_LITERAL_STRING("x")))
if (formatStr.EqualsLiteral("x"))
formatStr = format;
// else make sure it matches previously found format
else if (format != formatStr)
@ -3293,7 +3293,7 @@ nsHTMLEditRules::WillMakeBasicBlock(nsISelection *aSelection,
// get selection location
res = mHTMLEditor->GetStartNodeAndOffset(aSelection, address_of(parent), &offset);
if (NS_FAILED(res)) return res;
if (tString.Equals(NS_LITERAL_STRING("normal")) ||
if (tString.EqualsLiteral("normal") ||
tString.IsEmpty() ) // we are removing blocks (going to "body text")
{
nsCOMPtr<nsIDOMNode> curBlock = parent;
@ -3367,9 +3367,9 @@ nsHTMLEditRules::WillMakeBasicBlock(nsISelection *aSelection,
// Ok, now go through all the nodes and make the right kind of blocks,
// or whatever is approriate. Wohoo!
// Note: blockquote is handled a little differently
if (tString.Equals(NS_LITERAL_STRING("blockquote")))
if (tString.EqualsLiteral("blockquote"))
res = MakeBlockquote(arrayOfNodes);
else if (tString.Equals(NS_LITERAL_STRING("normal")) ||
else if (tString.EqualsLiteral("normal") ||
tString.IsEmpty() )
res = RemoveBlockStyle(arrayOfNodes);
else
@ -6705,10 +6705,10 @@ nsHTMLEditRules::RemoveBlockStyle(nsCOMArray<nsIDOMNode>& arrayOfNodes)
}
else if (nsHTMLEditUtils::IsTable(curNode) ||
nsHTMLEditUtils::IsTableRow(curNode) ||
(curNodeTag.Equals(NS_LITERAL_STRING("tbody"))) ||
(curNodeTag.Equals(NS_LITERAL_STRING("td"))) ||
(curNodeTag.EqualsLiteral("tbody")) ||
(curNodeTag.EqualsLiteral("td")) ||
nsHTMLEditUtils::IsList(curNode) ||
(curNodeTag.Equals(NS_LITERAL_STRING("li"))) ||
(curNodeTag.EqualsLiteral("li")) ||
nsHTMLEditUtils::IsBlockquote(curNode) ||
nsHTMLEditUtils::IsDiv(curNode))
{
@ -6839,11 +6839,11 @@ nsHTMLEditRules::ApplyBlockStyle(nsCOMArray<nsIDOMNode>& arrayOfNodes, const nsA
if (NS_FAILED(res)) return res;
}
else if (nsHTMLEditUtils::IsTable(curNode) ||
(curNodeTag.Equals(NS_LITERAL_STRING("tbody"))) ||
(curNodeTag.Equals(NS_LITERAL_STRING("tr"))) ||
(curNodeTag.Equals(NS_LITERAL_STRING("td"))) ||
(curNodeTag.EqualsLiteral("tbody")) ||
(curNodeTag.EqualsLiteral("tr")) ||
(curNodeTag.EqualsLiteral("td")) ||
nsHTMLEditUtils::IsList(curNode) ||
(curNodeTag.Equals(NS_LITERAL_STRING("li"))) ||
(curNodeTag.EqualsLiteral("li")) ||
nsHTMLEditUtils::IsBlockquote(curNode) ||
nsHTMLEditUtils::IsDiv(curNode))
{
@ -6872,7 +6872,7 @@ nsHTMLEditRules::ApplyBlockStyle(nsCOMArray<nsIDOMNode>& arrayOfNodes, const nsA
}
// if the node is a break, we honor it by putting further nodes in a new parent
else if (curNodeTag.Equals(NS_LITERAL_STRING("br")))
else if (curNodeTag.EqualsLiteral("br"))
{
if (curBlock)
{

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

@ -401,7 +401,7 @@ nsHTMLEditUtils::IsMailCite(nsIDOMNode *node)
ToLowerCase(attrVal);
if (NS_SUCCEEDED(res))
{
if (attrVal.Equals(NS_LITERAL_STRING("cite")))
if (attrVal.EqualsLiteral("cite"))
return PR_TRUE;
}
@ -411,7 +411,7 @@ nsHTMLEditUtils::IsMailCite(nsIDOMNode *node)
if (NS_SUCCEEDED(res))
{
ToLowerCase(attrVal);
if (attrVal.Equals(NS_LITERAL_STRING("true")))
if (attrVal.EqualsLiteral("true"))
return PR_TRUE;
}

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

@ -2219,7 +2219,7 @@ nsHTMLEditor::SetParagraphFormat(const nsAString& aParagraphFormat)
{
nsAutoString tag; tag.Assign(aParagraphFormat);
ToLowerCase(tag);
if (tag.Equals(NS_LITERAL_STRING("dd")) || tag.Equals(NS_LITERAL_STRING("dt")))
if (tag.EqualsLiteral("dd") || tag.EqualsLiteral("dt"))
return MakeDefinitionItem(tag);
else
return InsertBasicBlock(tag);
@ -2461,8 +2461,8 @@ nsHTMLEditor::GetCSSBackgroundColorState(PRBool *aMixed, nsAString &aOutColor, P
htmlElement = do_QueryInterface(tmp);
// look at parent if the queried color is transparent and if the node to
// examine is not the root of the document
} while ( aOutColor.Equals(NS_LITERAL_STRING("transparent")) && htmlElement );
if (!htmlElement && aOutColor.Equals(NS_LITERAL_STRING("transparent"))) {
} while ( aOutColor.EqualsLiteral("transparent") && htmlElement );
if (!htmlElement && aOutColor.EqualsLiteral("transparent")) {
// we have hit the root of the document and the color is still transparent !
// Grumble... Let's look at the default background color because that's the
// color we are looking for
@ -2491,7 +2491,7 @@ nsHTMLEditor::GetCSSBackgroundColorState(PRBool *aMixed, nsAString &aOutColor, P
// node to examine
mHTMLCSSUtils->GetComputedProperty(nodeToExamine, nsEditProperty::cssBackgroundColor,
aOutColor);
if (!aOutColor.Equals(NS_LITERAL_STRING("transparent"))) {
if (!aOutColor.EqualsLiteral("transparent")) {
break;
}
}
@ -2499,7 +2499,7 @@ nsHTMLEditor::GetCSSBackgroundColorState(PRBool *aMixed, nsAString &aOutColor, P
if (NS_FAILED(res)) return res;
nodeToExamine = tmp;
htmlElement = do_QueryInterface(tmp);
} while ( aOutColor.Equals(NS_LITERAL_STRING("transparent")) && htmlElement );
} while ( aOutColor.EqualsLiteral("transparent") && htmlElement );
}
return NS_OK;
}
@ -2848,7 +2848,7 @@ nsHTMLEditor::Indent(const nsAString& aIndent)
if (!node) res = NS_ERROR_FAILURE;
if (NS_FAILED(res)) return res;
if (aIndent == NS_LITERAL_STRING("indent"))
if (aIndent.EqualsLiteral("indent"))
{
if (isCollapsed)
{
@ -2966,8 +2966,8 @@ nsHTMLEditor::GetElementOrParentByTagName(const nsAString& aTagName, nsIDOMNode
{
TagName.Assign(NS_LITERAL_STRING("a"));
}
PRBool findTableCell = TagName.Equals(NS_LITERAL_STRING("td"));
PRBool findList = TagName.Equals(NS_LITERAL_STRING("list"));
PRBool findTableCell = TagName.EqualsLiteral("td");
PRBool findList = TagName.EqualsLiteral("list");
// default is null - no element found
*aReturn = nsnull;
@ -3315,7 +3315,7 @@ nsHTMLEditor::CreateElementWithDefaults(const nsAString& aTagName, nsIDOMElement
newElement->SetAttribute(NS_LITERAL_STRING("_moz_dirty"), EmptyString());
// Set default values for new elements
if (TagName.Equals(NS_LITERAL_STRING("hr")))
if (TagName.EqualsLiteral("hr"))
{
// Note that we read the user's attributes for these from prefs (in InsertHLine JS)
res = SetAttributeOrEquivalent(newElement, NS_LITERAL_STRING("width"),
@ -3323,14 +3323,14 @@ nsHTMLEditor::CreateElementWithDefaults(const nsAString& aTagName, nsIDOMElement
if (NS_FAILED(res)) return res;
res = SetAttributeOrEquivalent(newElement, NS_LITERAL_STRING("size"),
NS_LITERAL_STRING("2"), PR_TRUE);
} else if (TagName.Equals(NS_LITERAL_STRING("table")))
} else if (TagName.EqualsLiteral("table"))
{
res = newElement->SetAttribute(NS_LITERAL_STRING("cellpadding"),NS_LITERAL_STRING("2"));
if (NS_FAILED(res)) return res;
res = newElement->SetAttribute(NS_LITERAL_STRING("cellspacing"),NS_LITERAL_STRING("2"));
if (NS_FAILED(res)) return res;
res = newElement->SetAttribute(NS_LITERAL_STRING("border"),NS_LITERAL_STRING("1"));
} else if (TagName.Equals(NS_LITERAL_STRING("td")))
} else if (TagName.EqualsLiteral("td"))
{
res = SetAttributeOrEquivalent(newElement, NS_LITERAL_STRING("valign"),
NS_LITERAL_STRING("top"), PR_TRUE);
@ -3905,9 +3905,9 @@ nsHTMLEditor::GetEmbeddedObjects(nsISupportsArray** aNodeList)
ToLowerCase(tagName);
// See if it's an image or an embed
if (tagName.Equals(NS_LITERAL_STRING("img")) || tagName.Equals(NS_LITERAL_STRING("embed")))
if (tagName.EqualsLiteral("img") || tagName.EqualsLiteral("embed"))
(*aNodeList)->AppendElement(node);
else if (tagName.Equals(NS_LITERAL_STRING("a")))
else if (tagName.EqualsLiteral("a"))
{
// Only include links if they're links to file: URLs
nsCOMPtr<nsIDOMHTMLAnchorElement> anchor (do_QueryInterface(content));
@ -3920,7 +3920,7 @@ nsHTMLEditor::GetEmbeddedObjects(nsISupportsArray** aNodeList)
(*aNodeList)->AppendElement(node);
}
}
else if (tagName.Equals(NS_LITERAL_STRING("body")))
else if (tagName.EqualsLiteral("body"))
{
nsCOMPtr<nsIDOMElement> element = do_QueryInterface(node);
if (element)
@ -3992,7 +3992,7 @@ nsCOMPtr<nsIDOMNode> nsHTMLEditor::FindUserSelectAllNode(nsIDOMNode *aNode)
while (node)
{
mHTMLCSSUtils->GetComputedProperty(node, nsEditProperty::cssMozUserSelect, mozUserSelectValue);
if (mozUserSelectValue.Equals(NS_LITERAL_STRING("all")))
if (mozUserSelectValue.EqualsLiteral("all"))
{
resultNode = node;
}
@ -4353,9 +4353,9 @@ nsHTMLEditor::TagCanContainTag(const nsAString& aParentTag, const nsAString& aCh
/*
// if parent is a pre, and child is not inline, say "no"
if ( aParentTag.Equals(NS_LITERAL_STRING("pre")) )
if ( aParentTag.EqualsLiteral("pre") )
{
if (aChildTag.Equals(NS_LITERAL_STRING("__moz_text")))
if (aChildTag.EqualsLiteral("__moz_text"))
return PR_TRUE;
PRInt32 childTagEnum, parentTagEnum;
nsAutoString non_const_childTag(aChildTag);
@ -5511,7 +5511,7 @@ nsHTMLEditor::SetAttributeOrEquivalent(nsIDOMElement * aElement,
// count is an integer that represents the number of CSS declarations applied to the
// element. If it is zero, we found no equivalence in this implementation for the
// attribute
if (aAttribute.Equals(NS_LITERAL_STRING("style"))) {
if (aAttribute.EqualsLiteral("style")) {
// if it is the style attribute, just add the new value to the existing style
// attribute's value
nsAutoString existingValue;

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

@ -176,21 +176,21 @@ nsHTMLEditor::DoInlineTableEditingAction(nsIDOMElement * aElement)
PRBool hideUI = PR_FALSE;
PRBool hideResizersWithInlineTableUI = (mResizedObject == tableElement);
if (anonclass.Equals(NS_LITERAL_STRING("mozTableAddColumnBefore")))
if (anonclass.EqualsLiteral("mozTableAddColumnBefore"))
InsertTableColumn(1, PR_FALSE);
else if (anonclass.Equals(NS_LITERAL_STRING("mozTableAddColumnAfter")))
else if (anonclass.EqualsLiteral("mozTableAddColumnAfter"))
InsertTableColumn(1, PR_TRUE);
else if (anonclass.Equals(NS_LITERAL_STRING("mozTableAddRowBefore")))
else if (anonclass.EqualsLiteral("mozTableAddRowBefore"))
InsertTableRow(1, PR_FALSE);
else if (anonclass.Equals(NS_LITERAL_STRING("mozTableAddRowAfter")))
else if (anonclass.EqualsLiteral("mozTableAddRowAfter"))
InsertTableRow(1, PR_TRUE);
else if (anonclass.Equals(NS_LITERAL_STRING("mozTableRemoveColumn"))) {
else if (anonclass.EqualsLiteral("mozTableRemoveColumn")) {
DeleteTableColumn(1);
#ifndef DISABLE_TABLE_DELETION
hideUI = (colCount == 1);
#endif
}
else if (anonclass.Equals(NS_LITERAL_STRING("mozTableRemoveRow"))) {
else if (anonclass.EqualsLiteral("mozTableRemoveRow")) {
DeleteTableRow(1);
#ifndef DISABLE_TABLE_DELETION
hideUI = (rowCount == 1);

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

@ -620,13 +620,13 @@ nsHTMLEditor::MouseDown(PRInt32 aClientX, PRInt32 aClientY,
nsAutoString anonclass;
nsresult res = aTarget->GetAttribute(NS_LITERAL_STRING("_moz_anonclass"), anonclass);
if (NS_FAILED(res)) return res;
if (anonclass.Equals(NS_LITERAL_STRING("mozResizer"))) {
if (anonclass.EqualsLiteral("mozResizer")) {
// and that element is a resizer, let's start resizing!
mOriginalX = aClientX;
mOriginalY = aClientY;
return StartResizing(aTarget);
}
if (anonclass.Equals(NS_LITERAL_STRING("mozGrabber"))) {
if (anonclass.EqualsLiteral("mozGrabber")) {
// and that element is a grabber, let's start moving the element!
mOriginalX = aClientX;
mOriginalY = aClientY;

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

@ -2939,7 +2939,7 @@ nsHTMLEditor::GetCellContext(nsISelection **aSelection,
res = GetSelectedOrParentTableElement(tagName, &selectedCount,
getter_AddRefs(cellOrTableElement));
if (NS_FAILED(res)) return res;
if (tagName.Equals(NS_LITERAL_STRING("table")))
if (tagName.EqualsLiteral("table"))
{
// We have a selected table, not a cell
if (aTable)
@ -2949,7 +2949,7 @@ nsHTMLEditor::GetCellContext(nsISelection **aSelection,
}
return NS_OK;
}
if (!tagName.Equals(NS_LITERAL_STRING("td")))
if (!tagName.EqualsLiteral("td"))
return NS_EDITOR_ELEMENT_NOT_FOUND;
// We found a cell

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

@ -1337,7 +1337,7 @@ nsPlaintextEditor::GetAndInitDocEncoder(const nsAString& aFormatType,
NS_ENSURE_SUCCESS(rv, rv);
if (!aCharset.IsEmpty()
&& !(aCharset.Equals(NS_LITERAL_CSTRING("null"))))
&& !(aCharset.EqualsLiteral("null")))
docEncoder->SetCharset(aCharset);
PRInt32 wc;
@ -1443,7 +1443,7 @@ nsPlaintextEditor::OutputToStream(nsIOutputStream* aOutputStream,
// special-case for empty document when requesting plain text,
// to account for the bogus text node.
// XXX Should there be a similar test in OutputToString?
if (aFormatType == NS_LITERAL_STRING("text/plain"))
if (aFormatType.EqualsLiteral("text/plain"))
{
PRBool docEmpty;
rv = GetDocumentIsEmpty(&docEmpty);

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

@ -659,7 +659,7 @@ nsTextEditRules::WillInsertText(PRInt32 aAction,
nsDependentSubstring subStr(tString, oldPos, subStrLen);
// is it a return?
if (subStr.Equals(NS_LITERAL_STRING(LFSTR)))
if (subStr.EqualsLiteral(LFSTR))
{
if (nsIPlaintextEditor::eEditorSingleLineMask & mFlags)
{
@ -727,13 +727,13 @@ nsTextEditRules::WillInsertText(PRInt32 aAction,
nsDependentSubstring subStr(tString, oldPos, subStrLen);
// is it a tab?
if (subStr.Equals(NS_LITERAL_STRING("\t")))
if (subStr.EqualsLiteral("\t"))
{
res = mEditor->InsertTextImpl(NS_LITERAL_STRING(" "), address_of(curNode), &curOffset, doc);
pos++;
}
// is it a return?
else if (subStr.Equals(NS_LITERAL_STRING(LFSTR)))
else if (subStr.EqualsLiteral(LFSTR))
{
res = mEditor->CreateBRImpl(address_of(curNode), &curOffset, address_of(unused), nsIEditor::eNone);
pos++;
@ -1084,7 +1084,7 @@ nsTextEditRules::WillOutputText(nsISelection *aSelection,
nsAutoString outputFormat(*aOutputFormat);
ToLowerCase(outputFormat);
if (outputFormat.Equals(NS_LITERAL_STRING("text/plain")))
if (outputFormat.EqualsLiteral("text/plain"))
{ // only use these rules for plain text output
if (mFlags & nsIPlaintextEditor::eEditorPasswordMask)
{

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

@ -200,7 +200,7 @@ NS_IMETHODIMP CBrowserShellProgressListener::OnStateChange(nsIWebProgress *aWebP
NS_ENSURE_TRUE(channel, NS_ERROR_FAILURE);
nsCAutoString contentType;
channel->GetContentType(contentType);
if (contentType.Equals(NS_LITERAL_CSTRING("text/html")))
if (contentType.EqualsLiteral("text/html"))
mUseRealProgFlag = true;
}

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

@ -106,9 +106,9 @@ nsContextMenuInfo::GetAssociatedLink(nsAString& aHRef)
nsCOMPtr<nsIDOMElement> linkContent;
ToLowerCase(localName);
if (localName.Equals(NS_LITERAL_STRING("a")) ||
localName.Equals(NS_LITERAL_STRING("area")) ||
localName.Equals(NS_LITERAL_STRING("link"))) {
if (localName.EqualsLiteral("a") ||
localName.EqualsLiteral("area") ||
localName.EqualsLiteral("link")) {
PRBool hasAttr;
content->HasAttribute(NS_LITERAL_STRING("href"), &hasAttr);
if (hasAttr) {
@ -137,7 +137,7 @@ nsContextMenuInfo::GetAssociatedLink(nsAString& aHRef)
break;
content->GetLocalName(localName);
ToLowerCase(localName);
if (localName.Equals(NS_LITERAL_STRING("a"))) {
if (localName.EqualsLiteral("a")) {
PRBool hasAttr;
content->HasAttribute(NS_LITERAL_STRING("href"), &hasAttr);
if (hasAttr) {
@ -326,7 +326,7 @@ nsContextMenuInfo::GetBackgroundImageRequestInternal(nsIDOMNode *aDOMNode, imgIR
primitiveValue = do_QueryInterface(cssValue);
if (primitiveValue) {
primitiveValue->GetStringValue(bgStringValue);
if (!bgStringValue.Equals(NS_LITERAL_STRING("none"))) {
if (!bgStringValue.EqualsLiteral("none")) {
nsCOMPtr<nsIURI> bgUri;
NS_NewURI(getter_AddRefs(bgUri), bgStringValue);
NS_ENSURE_TRUE(bgUri, NS_ERROR_FAILURE);
@ -347,7 +347,7 @@ nsContextMenuInfo::GetBackgroundImageRequestInternal(nsIDOMNode *aDOMNode, imgIR
primitiveValue = do_QueryInterface(cssValue);
if (primitiveValue) {
primitiveValue->GetStringValue(bgStringValue);
if (!bgStringValue.Equals(NS_LITERAL_STRING("transparent")))
if (!bgStringValue.EqualsLiteral("transparent"))
return NS_ERROR_FAILURE;
}
}

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

@ -227,7 +227,7 @@ nsDocShellTreeOwner::FindItemWithName(const PRUnichar* aName,
return NS_OK;
// _main is an IE target which should be case-insensitive but isn't
// see bug 217886 for details
if(name.EqualsIgnoreCase("_content") || name.Equals(NS_LITERAL_STRING("_main"))) {
if(name.EqualsIgnoreCase("_content") || name.EqualsLiteral("_main")) {
*aFoundItem = mWebBrowser->mDocShellAsItem;
NS_IF_ADDREF(*aFoundItem);
return NS_OK;

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

@ -920,7 +920,7 @@ ShowNativePrintDialog(HWND aHWnd,
if (NS_SUCCEEDED(GetLocalizedBundle(PRINTDLG_PROPERTIES, getter_AddRefs(strBundle)))) {
nsAutoString doExtendStr;
if (NS_SUCCEEDED(GetLocalizedString(strBundle, "extend", doExtendStr))) {
doExtend = doExtendStr.Equals(NS_LITERAL_STRING("true"));
doExtend = doExtendStr.EqualsLiteral("true");
}
}

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

@ -2618,7 +2618,7 @@ nsresult nsWebBrowserPersist::OnWalkDOMNode(nsIDOMNode *aNode)
{
nsAutoString target;
nodeAsPI->GetTarget(target);
if (target.Equals(NS_LITERAL_STRING("xml-stylesheet")))
if (target.EqualsLiteral("xml-stylesheet"))
{
nsAutoString href;
GetXMLStyleSheetLink(nodeAsPI, href);
@ -2810,7 +2810,7 @@ nsWebBrowserPersist::CloneNodeWithFixedUpURIAttributes(
{
nsAutoString target;
nodeAsPI->GetTarget(target);
if (target.Equals(NS_LITERAL_STRING("xml-stylesheet")))
if (target.EqualsLiteral("xml-stylesheet"))
{
rv = GetNodeToFixup(aNodeIn, aNodeOut);
if (NS_SUCCEEDED(rv) && *aNodeOut)
@ -3465,7 +3465,7 @@ static PRBool IsSpecialXHTMLTag(nsIDOMNode *aNode)
{
nsAutoString ns;
aNode->GetNamespaceURI(ns);
if (!ns.Equals(NS_LITERAL_STRING("http://www.w3.org/1999/xhtml")))
if (!ns.EqualsLiteral("http://www.w3.org/1999/xhtml"))
return PR_FALSE;
// Ordered so that typical documents work fastest

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

@ -276,18 +276,18 @@ nsEmbedChromeRegistry::RegisterChrome(const nsACString& aChromeType,
const nsACString& aChromeLocation)
{
PRInt32 chromeType;
if (aChromeType.Equals(NS_LITERAL_CSTRING("skin")))
if (aChromeType.EqualsLiteral("skin"))
chromeType = CHROME_TYPE_SKIN;
else if (aChromeType.Equals(NS_LITERAL_CSTRING("locale")))
else if (aChromeType.EqualsLiteral("locale"))
chromeType = CHROME_TYPE_LOCALE;
else
chromeType = CHROME_TYPE_CONTENT;
PRBool chromeIsProfile =
aChromeProfile.Equals(NS_LITERAL_CSTRING("profile"));
aChromeProfile.EqualsLiteral("profile");
PRBool chromeIsURL =
aChromeProfile.Equals(NS_LITERAL_CSTRING("url"));
aChromeProfile.EqualsLiteral("url");
return RegisterChrome(chromeType, chromeIsProfile, chromeIsURL,
aChromeLocation);

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

@ -916,7 +916,7 @@ ShowNativePrintDialog(HWND aHWnd,
if (NS_SUCCEEDED(GetLocalizedBundle(PRINTDLG_PROPERTIES, getter_AddRefs(strBundle)))) {
nsAutoString doExtendStr;
if (NS_SUCCEEDED(GetLocalizedString(strBundle, "extend", doExtendStr))) {
doExtend = doExtendStr.Equals(NS_LITERAL_STRING("true"));
doExtend = doExtendStr.EqualsLiteral("true");
}
}

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

@ -147,7 +147,7 @@ NS_IMETHODIMP nsAccessProxy::HandleEvent(nsIDOMEvent* aEvent)
}
//return NS_OK;
/*
if (presShell && eventNameStr.Equals(NS_LITERAL_STRING("click"))) {
if (presShell && eventNameStr.EqualsLiteral("click")) {
nsCOMPtr<nsIFrameSelection> frameSelection;
presShell->GetFrameSelection(getter_AddRefs(frameSelection));
if (!frameSelection)
@ -186,10 +186,10 @@ NS_IMETHODIMP nsAccessProxy::Observe(nsISupports *aSubject, const char *aTopic,
nsresult rv = NS_OK;
nsDependentCString aTopicString(aTopic);
if (accessProxyInstalled && aTopicString.Equals(NS_LITERAL_CSTRING(NS_XPCOM_SHUTDOWN_OBSERVER_ID)))
if (accessProxyInstalled && aTopicString.EqualsLiteral(NS_XPCOM_SHUTDOWN_OBSERVER_ID))
return Release();
if (!accessProxyInstalled && aTopicString.Equals(NS_LITERAL_CSTRING(APPSTARTUP_CATEGORY))) {
if (!accessProxyInstalled && aTopicString.EqualsLiteral(APPSTARTUP_CATEGORY)) {
accessProxyInstalled = PR_TRUE; // Set to TRUE even for failure cases - we don't want to try more than once
nsCOMPtr<nsIWebProgress> progress(do_GetService(NS_DOCUMENTLOADER_SERVICE_CONTRACTID));
rv = NS_ERROR_FAILURE;

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

@ -656,7 +656,7 @@ nsPermissionManager::Read()
// Split the line at tabs
lineArray.ParseString(buffer.get(), "\t");
if (lineArray[0]->Equals(NS_LITERAL_CSTRING(kMatchTypeHost)) &&
if (lineArray[0]->EqualsLiteral(kMatchTypeHost) &&
lineArray.Count() == 4) {
PRInt32 error;
@ -759,7 +759,7 @@ nsPermissionManager::Read()
continue;
// Ignore @@@ as host. Old style checkbox status
if (!permissionString.IsEmpty() && !host.Equals(NS_LITERAL_CSTRING("@@@@"))) {
if (!permissionString.IsEmpty() && !host.EqualsLiteral("@@@@")) {
rv = AddInternal(host, type, permission, PR_FALSE);
if (NS_FAILED(rv)) return rv;
}

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

@ -408,21 +408,21 @@ inDOMView::GetCellText(PRInt32 row, nsITreeColumn* col, nsAString& _retval)
nsAutoString colID;
col->GetId(colID);
if (colID.Equals(NS_LITERAL_STRING("colNodeName")))
if (colID.EqualsLiteral("colNodeName"))
domNode->GetNodeName(_retval);
else if (colID.Equals(NS_LITERAL_STRING("colLocalName")))
else if (colID.EqualsLiteral("colLocalName"))
domNode->GetLocalName(_retval);
else if (colID.Equals(NS_LITERAL_STRING("colPrefix")))
else if (colID.EqualsLiteral("colPrefix"))
domNode->GetPrefix(_retval);
else if (colID.Equals(NS_LITERAL_STRING("colNamespaceURI")))
else if (colID.EqualsLiteral("colNamespaceURI"))
domNode->GetNamespaceURI(_retval);
else if (colID.Equals(NS_LITERAL_STRING("colNodeType"))) {
else if (colID.EqualsLiteral("colNodeType")) {
PRUint16 nodeType;
domNode->GetNodeType(&nodeType);
nsAutoString temp;
temp.AppendInt(PRInt32(nodeType));
_retval = temp;
} else if (colID.Equals(NS_LITERAL_STRING("colNodeValue")))
} else if (colID.EqualsLiteral("colNodeValue"))
domNode->GetNodeValue(_retval);
else {
if (StringBeginsWith(colID, NS_LITERAL_STRING("col@"))) {

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

@ -271,7 +271,7 @@ nsPolicyReference::ProcessPolicyReferenceFile(nsIDOMDocument* aDocument,
nsresult result = NS_OK;
// The root element MUST be META
mError = name.Equals(NS_LITERAL_STRING("META"))
mError = name.EqualsLiteral("META")
? POLICY_LOAD_SUCCESS : POLICY_SYNTAX_ERROR;
if (mError != POLICY_LOAD_SUCCESS)

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

@ -238,7 +238,7 @@ NS_IMETHODIMP mozMySpell::GetDictionaryList(PRUnichar ***dictionaries, PRUint32
nsString fileName;
theFile->GetLeafName(fileName);
PRInt32 dotLocation = fileName.FindChar('.');
if((dotLocation != -1) && Substring(fileName,dotLocation,4).Equals(NS_LITERAL_STRING(".dic"))){
if((dotLocation != -1) && Substring(fileName,dotLocation,4).EqualsLiteral(".dic")){
if(tempCount >= arraySize){
arraySize = 2 * tempCount;
newPtr = (PRUnichar **)nsMemory::Alloc(sizeof(PRUnichar *) * arraySize);

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

@ -930,10 +930,10 @@ mozSqlResult::SetCellValue(PRInt32 row, nsITreeColumn* col, const nsAString& val
Cell* cell = buffer->mCells[columnIndex];
if (value.Equals(NS_LITERAL_STRING("true"))) {
if (value.EqualsLiteral("true")) {
cell->mBool = PR_TRUE;
}
else if (value.Equals(NS_LITERAL_STRING("false"))) {
else if (value.EqualsLiteral("false")) {
cell->mBool = PR_FALSE;
}

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

@ -1,424 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is TransforMiiX XSLT processor code.
*
* The Initial Developer of the Original Code is
* Axel Hecht.
* Portions created by the Initial Developer are Copyright (C) 2003
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Axel Hecht <axel@pike.org>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "txStandaloneXSLTProcessor.h"
#include "nsXPCOM.h"
#include <fstream.h>
#include "nsDoubleHashtable.h"
#include "nsIComponentManager.h"
#include "nsILocalFile.h"
#include "nsISimpleEnumerator.h"
#include "nsString.h"
#include "nsVoidArray.h"
#include "prenv.h"
#include "prsystem.h"
#include "nsDirectoryServiceUtils.h"
#include "nsDirectoryServiceDefs.h"
#ifdef NS_TRACE_MALLOC
#include "nsTraceMalloc.h"
#endif
#ifdef MOZ_JPROF
#include "jprof.h"
#endif
/**
* Prints the command line help screen to the console
*/
void printHelp()
{
cerr << "testXalan [-o output-file] [category]*" << endl << endl;
cerr << "Options:";
cerr << endl << endl;
cerr << "\t-o specify output file (default: write to stdout)";
cerr << endl << endl;
cerr << "\t Specify XALAN_DIR in your environement." << endl;
cerr << endl;
}
/**
* Helper class to report success and failure to RDF
*/
class txRDFOut
{
public:
explicit txRDFOut(ostream* aOut)
: mOut(aOut), mSuccess(0), mFail(0), mParent(nsnull)
{
}
explicit txRDFOut(const nsACString& aName, txRDFOut* aParent)
: mName(aName), mOut(aParent->mOut), mSuccess(0), mFail(0),
mParent(aParent)
{
}
~txRDFOut()
{
*mOut << " <RDF:Description about=\"urn:x-buster:conf" <<
mName.get() <<
"\">\n" <<
" <NC:orig_succCount NC:parseType=\"Integer\">" <<
mSuccess <<
"</NC:orig_succCount>\n" <<
" <NC:orig_failCount NC:parseType=\"Integer\">" <<
mFail <<
"</NC:orig_failCount>\n" <<
" </RDF:Description>" << endl;
}
void feed(const nsACString& aTest, PRBool aSuccess)
{
*mOut << " <RDF:Description about=\"urn:x-buster:" <<
PromiseFlatCString(aTest).get() <<
"\"\n NC:orig_succ=\"";
if (aSuccess) {
*mOut << "yes";
succeeded();
}
else {
*mOut << "no";
failed();
}
*mOut << "\" />\n";
}
void succeeded()
{
if (mParent)
mParent->succeeded();
++mSuccess;
}
void failed()
{
if (mParent)
mParent->failed();
++mFail;
}
private:
nsCAutoString mName;
ostream* mOut;
PRUint32 mSuccess, mFail;
txRDFOut* mParent;
};
static void
readToString(istream& aIstream, nsACString& aString)
{
static char buffer[1024];
int read = 0;
do {
aIstream.read(buffer, 1024);
read = aIstream.gcount();
aString.Append(Substring(buffer, buffer + read));
} while (!aIstream.eof());
}
/**
* Get the XALAN_DIR environment variable and return a nsIFile for
* the conf and the conf-gold subdirectory. Create a TEMP file, too.
* Return an error if either does not exist.
*/
static nsresult
setupXalan(const char* aPath, nsIFile** aConf, nsIFile** aConfGold,
nsIFile** aTemp)
{
nsresult rv;
nsCOMPtr<nsILocalFile> conf(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID,
&rv));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr <nsIFile> tmpFile;
rv = NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(tmpFile));
NS_ENSURE_SUCCESS(rv, rv);
tmpFile->Append(NS_LITERAL_STRING("xalan.out"));
rv = tmpFile->CreateUnique(nsIFile::NORMAL_FILE_TYPE, 0600);
rv = conf->InitWithNativePath(nsDependentCString(aPath));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIFile> gold;
rv = conf->Clone(getter_AddRefs(gold));
NS_ENSURE_SUCCESS(rv, rv);
rv = conf->Append(NS_LITERAL_STRING("conf"));
NS_ENSURE_SUCCESS(rv, rv);
PRBool isDir;
rv = conf->IsDirectory(&isDir);
if (NS_FAILED(rv) || !isDir) {
return NS_ERROR_FILE_NOT_DIRECTORY;
}
rv = gold->Append(NS_LITERAL_STRING("conf-gold"));
NS_ENSURE_SUCCESS(rv, rv);
rv = gold->IsDirectory(&isDir);
if (NS_FAILED(rv) || !isDir || !conf || !gold) {
return NS_ERROR_FILE_NOT_DIRECTORY;
}
// got conf and conf-gold subdirectories
*aConf = conf;
NS_ADDREF(*aConf);
*aConfGold = gold;
NS_ADDREF(*aConfGold);
*aTemp = tmpFile;
NS_ADDREF(*aTemp);
return NS_OK;
}
/**
* Run a category of Xalan tests
*/
void runCategory(nsIFile* aConfCat, nsIFile* aGoldCat, nsIFile* aRefTmp,
txRDFOut* aOut)
{
nsresult rv;
//clone the nsIFiles, so that we can return easily
nsCOMPtr<nsIFile> conf, gold;
aConfCat->Clone(getter_AddRefs(conf));
aGoldCat->Clone(getter_AddRefs(gold));
nsCAutoString catName, refTmp;
conf->GetNativeLeafName(catName);
aRefTmp->GetNativePath(refTmp);
txRDFOut results(catName, aOut);
nsCOMPtr<nsISimpleEnumerator> tests;
rv = conf->GetDirectoryEntries(getter_AddRefs(tests));
if (NS_FAILED(rv))
return;
PRBool hasMore, isFile;
nsCAutoString leaf;
NS_NAMED_LITERAL_CSTRING(xsl, ".xsl");
while (NS_SUCCEEDED(tests->HasMoreElements(&hasMore)) && hasMore) {
nsCOMPtr<nsILocalFile> test;
tests->GetNext(getter_AddRefs(test));
test->GetNativeLeafName(leaf);
if (xsl.Equals(Substring(leaf, leaf.Length()-4, 4))) {
// we have a stylesheet, let's look for source and reference
nsAFlatCString::char_iterator start, ext;
leaf.BeginWriting(start);
leaf.EndWriting(ext);
ext -= 2;
// overwrite extension with .xml
*ext = 'm'; // this one was easy
nsCOMPtr<nsIFile> source;
conf->Clone(getter_AddRefs(source));
rv = source->AppendNative(leaf);
if (NS_SUCCEEDED(rv) && NS_SUCCEEDED(source->IsFile(&isFile)) &&
isFile) {
nsCOMPtr<nsIFile> reference;
gold->Clone(getter_AddRefs(reference));
// overwrite extension with .out
--ext;
nsCharTraits<char>::copy(ext, "out", 3);
rv = reference->AppendNative(leaf);
if (NS_SUCCEEDED(rv) &&
NS_SUCCEEDED(reference->IsFile(&isFile)) &&
isFile) {
nsCAutoString src, style, refPath;
test->GetNativePath(style);
source->GetNativePath(src);
reference->GetNativePath(refPath);
if (PR_GetDirectorySeparator() =='\\') {
src.ReplaceChar('\\','/');
style.ReplaceChar('\\','/');
refPath.ReplaceChar('\\','/');
}
SimpleErrorObserver obs;
txStandaloneXSLTProcessor proc;
fstream result(refTmp.get(),
ios::in | ios::out | ios::trunc);
rv = proc.transform(src, style, result, obs);
PRBool success = PR_FALSE;
if (NS_SUCCEEDED(rv)) {
result.flush();
PRInt64 resultSize, refSize;
aRefTmp->GetFileSize(&resultSize);
reference->GetFileSize(&refSize);
result.seekg(0);
int toread = (int)resultSize;
nsCString resContent, refContent;
resContent.SetCapacity(toread);
readToString(result, resContent);
result.close();
ifstream refStream(refPath.get());
toread = (int)refSize;
refContent.SetCapacity(toread);
readToString(refStream, refContent);
refStream.close();
success = resContent.Equals(refContent);
}
ext--;
results.feed(Substring(start, ext), success);
}
}
}
}
}
/**
* The Xalan testcases app
*/
int main(int argc, char** argv)
{
#ifdef NS_TRACE_MALLOC
NS_TraceMallocStartupArgs(argc, argv);
#endif
#ifdef MOZ_JPROF
setupProfilingStuff();
#endif
char* xalan = PR_GetEnv("XALAN_DIR");
if (!xalan) {
printHelp();
return 1;
}
nsresult rv;
rv = NS_InitXPCOM2(nsnull, nsnull, nsnull);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIFile> conf, gold, resFile;
rv = setupXalan(xalan, getter_AddRefs(conf), getter_AddRefs(gold),
getter_AddRefs(resFile));
if (NS_FAILED(rv)) {
NS_ShutdownXPCOM(nsnull);
printHelp();
return -1;
}
//-- handle output stream
ostream* resultOutput = &cout;
ofstream resultFileStream;
int argn = 1;
// skip -- gnu style options
while (argn < argc) {
nsDependentCString opt(argv[argn]);
if (!Substring(opt, 0, 2).Equals(NS_LITERAL_CSTRING("--"))) {
break;
}
++argn;
}
if (argn < argc) {
nsDependentCString opt(argv[argn]);
if (Substring(opt, 0, 2).Equals(NS_LITERAL_CSTRING("-o"))) {
if (opt.Length() > 2) {
const nsAFlatCString& fname =
PromiseFlatCString(Substring(opt, 2, opt.Length()-2));
resultFileStream.open(fname.get(), ios::out);
}
else {
++argn;
if (argn < argc) {
resultFileStream.open(argv[argn], ios::out);
}
}
if (!resultFileStream) {
cerr << "error opening output file" << endl;
PRBool exists;
if (NS_SUCCEEDED(resFile->Exists(&exists)) && exists)
resFile->Remove(PR_FALSE);
NS_ShutdownXPCOM(nsnull);
return -1;
}
++argn;
resultOutput = &resultFileStream;
}
}
if (!txXSLTProcessor::init()) {
PRBool exists;
if (NS_SUCCEEDED(resFile->Exists(&exists)) && exists)
resFile->Remove(PR_FALSE);
NS_ShutdownXPCOM(nsnull);
return 1;
}
*resultOutput << "<?xml version=\"1.0\"?>\n" <<
"<RDF:RDF xmlns:NC=\"http://home.netscape.com/NC-rdf#\"\n" <<
" xmlns:RDF=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">" << endl;
txRDFOut* rdfOut = new txRDFOut(resultOutput);
nsCOMPtr<nsIFile> tempFile;
if (argn < argc) {
// categories are specified
while (argn < argc) {
nsDependentCString cat(argv[argn++]);
rv = conf->AppendNative(cat);
if (NS_SUCCEEDED(rv)) {
rv = gold->AppendNative(cat);
if (NS_SUCCEEDED(rv)) {
runCategory(conf, gold, resFile, rdfOut);
rv = gold->GetParent(getter_AddRefs(tempFile));
NS_ASSERTION(NS_SUCCEEDED(rv), "can't go back?");
gold = tempFile;
}
rv = conf->GetParent(getter_AddRefs(tempFile));
NS_ASSERTION(NS_SUCCEEDED(rv), "can't go back?");
conf = tempFile;
}
}
}
else {
// no category specified, do everything
nsCOMPtr<nsISimpleEnumerator> cats;
rv = conf->GetDirectoryEntries(getter_AddRefs(cats));
PRBool hasMore, isDir;
nsCAutoString leaf;
while (NS_SUCCEEDED(cats->HasMoreElements(&hasMore)) && hasMore) {
nsCOMPtr<nsILocalFile> cat;
cats->GetNext(getter_AddRefs(cat));
rv = cat->IsDirectory(&isDir);
if (NS_SUCCEEDED(rv) && isDir) {
rv = cat->GetNativeLeafName(leaf);
if (NS_SUCCEEDED(rv) &&
!leaf.Equals(NS_LITERAL_CSTRING("CVS"))) {
rv = gold->AppendNative(leaf);
if (NS_SUCCEEDED(rv)) {
runCategory(cat, gold, resFile, rdfOut);
rv = gold->GetParent(getter_AddRefs(tempFile));
gold = tempFile;
}
}
}
}
}
delete rdfOut;
rdfOut = nsnull;
*resultOutput << "</RDF:RDF>" << endl;
PRBool exists;
if (NS_SUCCEEDED(resFile->Exists(&exists)) && exists)
resFile->Remove(PR_FALSE);
resultFileStream.close();
txXSLTProcessor::shutdown();
rv = NS_ShutdownXPCOM(nsnull);
#ifdef NS_TRACE_MALLOC
NS_TraceMallocShutdown();
#endif
NS_ENSURE_SUCCESS(rv, rv);
return 0;
}

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

@ -1,209 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is TransforMiiX XSLT processor code.
*
* The Initial Developer of the Original Code is
* The MITRE Corporation.
* Portions created by the Initial Developer are Copyright (C) 1999
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "txStandaloneXSLTProcessor.h"
#include "nsXPCOM.h"
#include <fstream.h>
#include "nsDoubleHashtable.h"
#include "nsVoidArray.h"
#ifdef MOZ_JPROF
#include "jprof.h"
#endif
/**
* Prints the command line help screen to the console
*/
void printHelp()
{
cerr << "transfrmx [-h] [-i xml-file] [-s xslt-file] [-o output-file]" << endl << endl;
cerr << "Options:";
cerr << endl << endl;
cerr << "\t-i specify XML file to process" << endl;
cerr << "\t-s specify XSLT file to use for processing (default: use stylesheet" << endl
<< "\t\tspecified in XML file)" << endl;
cerr << "\t-o specify output file (default: write to stdout)" << endl;
cerr << "\t-h this help screen" << endl;
cerr << endl;
cerr << "You may use '-' in place of the output-file to explicitly specify" << endl;
cerr << "standard output." << endl;
cerr << endl;
}
/**
* Prints the command line usage information to the console
*/
void printUsage()
{
cerr << "transfrmx [-h] [-i xml-file] [-s xslt-file] [-o output-file]" << endl << endl;
cerr << "For more infomation use the -h flag" << endl;
}
class txOptionEntry : public PLDHashCStringEntry
{
public:
txOptionEntry(const void* aKey) : PLDHashCStringEntry(aKey)
{
}
~txOptionEntry()
{
}
nsCStringArray mValues;
};
DECL_DHASH_WRAPPER(txOptions, txOptionEntry, nsACString&)
DHASH_WRAPPER(txOptions, txOptionEntry, nsACString&)
/**
* Parses the command line
*/
void parseCommandLine(int argc, char** argv, txOptions& aOptions)
{
nsCAutoString flag;
for (int i = 1; i < argc; ++i) {
nsDependentCString arg(argv[i]);
if (*argv[i] == '-' && arg.Length() > 1) {
// clean up previous flag
if (!flag.IsEmpty()) {
aOptions.AddEntry(flag);
flag.Truncate();
}
// get next flag
flag = Substring(arg, 1, arg.Length() - 1);
}
else {
txOptionEntry* option = aOptions.AddEntry(flag);
if (option) {
option->mValues.AppendCString(nsCString(arg));
}
flag.Truncate();
}
}
if (!flag.IsEmpty()) {
aOptions.AddEntry(flag);
}
}
/**
* The TransforMiiX command line interface
*/
int main(int argc, char** argv)
{
using namespace std;
nsresult rv;
#ifdef MOZ_JPROF
setupProfilingStuff();
#endif
rv = NS_InitXPCOM2(nsnull, nsnull, nsnull);
NS_ENSURE_SUCCESS(rv, rv);
if (!txXSLTProcessor::init())
return 1;
txOptions options;
if (NS_FAILED(options.Init(4))) {
return 1;
}
parseCommandLine(argc, argv, options);
if (!options.GetEntry(NS_LITERAL_CSTRING("q"))) {
NS_NAMED_LITERAL_CSTRING(copyright, "(C) 1999 The MITRE Corporation, Keith Visco, and contributors");
cerr << "TransforMiiX ";
cerr << MOZILLA_VERSION << endl;
cerr << copyright.get() << endl;
//-- print banner line
PRUint32 fillSize = copyright.Length() + 1;
PRUint32 counter;
for (counter = 0; counter < fillSize; ++counter)
cerr << '-';
cerr << endl << endl;
}
if (options.GetEntry(NS_LITERAL_CSTRING("h"))) {
printHelp();
return 0;
}
//-- handle output stream
ostream* resultOutput = &cout;
ofstream resultFileStream;
txOptionEntry* option = options.GetEntry(NS_LITERAL_CSTRING("o"));
if (option &&
option->mValues.Count() > 0 &&
!option->mValues[0]->Equals(NS_LITERAL_CSTRING("-"))) {
resultFileStream.open(option->mValues[0]->get(), ios::out);
if (!resultFileStream) {
cerr << "error opening output file: ";
cerr << option->mValues[0]->get() << endl;
return -1;
}
resultOutput = &resultFileStream;
}
option = options.GetEntry(NS_LITERAL_CSTRING("i"));
if (!option || option->mValues.Count() == 0) {
cerr << "you must specify at least a source XML path" << endl;
printUsage();
return -1;
}
SimpleErrorObserver obs;
txStandaloneXSLTProcessor proc;
txOptionEntry* styleOption = options.GetEntry(NS_LITERAL_CSTRING("s"));
if (!styleOption || styleOption->mValues.Count() == 0) {
rv = proc.transform(*option->mValues[0], *resultOutput, obs);
}
else {
// XXX TODO: Handle multiple stylesheets
rv = proc.transform(*option->mValues[0], *styleOption->mValues[0],
*resultOutput, obs);
}
if (NS_FAILED(rv)) {
cerr << "transformation failed with " << hex << rv << endl;
}
resultFileStream.close();
txXSLTProcessor::shutdown();
rv = NS_ShutdownXPCOM(nsnull);
NS_ENSURE_SUCCESS(rv, rv);
return 0;
}

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

@ -527,19 +527,19 @@ nsTypeAheadFind::HandleEvent(nsIDOMEvent* aEvent)
nsAutoString eventType;
aEvent->GetType(eventType);
if (eventType.Equals(NS_LITERAL_STRING("DOMMenuBarActive"))) {
if (eventType.EqualsLiteral("DOMMenuBarActive")) {
mIsMenuBarActive = PR_TRUE;
}
else if (eventType.Equals(NS_LITERAL_STRING("DOMMenuBarInactive"))) {
else if (eventType.EqualsLiteral("DOMMenuBarInactive")) {
mIsMenuBarActive = PR_FALSE;
}
else if (eventType.Equals(NS_LITERAL_STRING("popupshown"))) {
else if (eventType.EqualsLiteral("popupshown")) {
mIsMenuPopupActive = PR_TRUE;
}
else if (eventType.Equals(NS_LITERAL_STRING("popuphidden"))) {
else if (eventType.EqualsLiteral("popuphidden")) {
mIsMenuPopupActive = PR_FALSE;
}
else if (eventType.Equals(NS_LITERAL_STRING("unload"))) {
else if (eventType.EqualsLiteral("unload")) {
// When document is unloaded, check to see if it's the
// current typeahead doc. If it is, cancel find
// and reset member variables so we don't leak
@ -608,7 +608,7 @@ nsTypeAheadFind::KeyPress(nsIDOMEvent* aEvent)
// by waiting for the first keystroke, we still get the startup time benefits.
mIsSoundInitialized = PR_TRUE;
mSoundInterface = do_CreateInstance("@mozilla.org/sound;1");
if (mSoundInterface && !mNotFoundSoundURL.Equals(NS_LITERAL_CSTRING("beep"))) {
if (mSoundInterface && !mNotFoundSoundURL.EqualsLiteral("beep")) {
mSoundInterface->Init();
}
}
@ -1626,7 +1626,7 @@ nsTypeAheadFind::RangeStartsInsideLink(nsIDOMRange *aRange,
if (*aIsInsideLink) {
nsAutoString xlinkType;
startContent->GetAttr(kNameSpaceID_XLink, typeAtom, xlinkType);
if (!xlinkType.Equals(NS_LITERAL_STRING("simple"))) {
if (!xlinkType.EqualsLiteral("simple")) {
*aIsInsideLink = PR_FALSE; // Xlink must be type="simple"
}
@ -1965,7 +1965,7 @@ nsTypeAheadFind::GetAutoStart(nsIDOMWindow *aDOMWin, PRBool *aIsAutoStartOn)
if (mLinksOnlyPref) {
nsAutoString contentType;
doc->GetContentType(contentType);
if (contentType.Equals(NS_LITERAL_STRING("text/plain"))) {
if (contentType.EqualsLiteral("text/plain")) {
return NS_OK; // No auto link search in plain text pages
}
}
@ -2879,7 +2879,7 @@ nsTypeAheadController::IsCommandEnabled(const char *aCommand, PRBool *aResult)
if (htmlDoc) {
nsAutoString designMode;
htmlDoc->GetDesignMode(designMode);
if (designMode.Equals(NS_LITERAL_STRING("on"))) {
if (designMode.EqualsLiteral("on")) {
*aResult = PR_FALSE;
}
}

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

@ -611,7 +611,7 @@ si_Randomize(nsString& password) {
PRIntervalTime randomNumber;
int i;
const char * hexDigits = "0123456789AbCdEf";
if (password.Equals(NS_LITERAL_STRING("********"))) {
if (password.EqualsLiteral("********")) {
randomNumber = PR_IntervalNow();
for (i=0; i<8; i++) {
password.SetCharAt(hexDigits[randomNumber%16], i);

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

@ -3005,7 +3005,7 @@ WLLT_PostEdit(const nsString& walletList)
tail = temp;
/* return if OK button was not pressed */
if (!head.Equals(NS_LITERAL_STRING("OK"))) {
if (!head.EqualsLiteral("OK")) {
return;
}
@ -3217,7 +3217,7 @@ WLLT_PrefillReturn(const nsString& results)
wallet_DecodeVerticalBars(urlName);
/* add url to url list if user doesn't want to preview this page in the future */
if (skip.Equals(NS_LITERAL_STRING("true"))) {
if (skip.EqualsLiteral("true")) {
nsCAutoString url = NS_ConvertUCS2toUTF8(urlName);
nsVoidArray* dummy;
nsCAutoString urlPermissions("nn");

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

@ -166,7 +166,7 @@ WSPProxyTest::TestComplexTypeWrapperInstance(nsIPropertyBag* propBag,
} \
\
prop->GetName(propName); \
if (!propName.Equals(NS_LITERAL_STRING(#_name))) { \
if (!propName.EqualsLiteral(#_name)) { \
aResult.Assign(NS_LITERAL_STRING("WSPProxyTest: Name doesn't match for property ") + NS_LITERAL_STRING(#_name)); \
return NS_ERROR_FAILURE; \
} \
@ -210,7 +210,7 @@ WSPProxyTest::TestComplexTypeWrapperInstance(nsIPropertyBag* propBag,
return rv;
}
if (!str.Equals(NS_LITERAL_STRING(STRING_VAL))) {
if (!str.EqualsLiteral(STRING_VAL)) {
aResult.Assign(NS_LITERAL_STRING("WSPProxyTest: Value doesn't match for property s"));
return NS_ERROR_FAILURE;
}
@ -363,7 +363,7 @@ WSPProxyTest::TestPropertyBagWrapper(nsAString& aResult)
aResult.Assign(NS_LITERAL_STRING("WSPProxyTest: Failed to get value for attribute s"));
return NS_OK;
}
if (!str.Equals(NS_LITERAL_STRING(STRING_VAL))) {
if (!str.EqualsLiteral(STRING_VAL)) {
aResult.Assign(NS_LITERAL_STRING("WSPProxyTest: Value doesn't match for attribute s"));
return NS_OK;
}

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

@ -64,7 +64,7 @@ nsSchema::nsSchema(nsISchemaCollection* aCollection,
elementFormDefault);
elementFormDefault.Trim(" \r\n\t");
mElementFormQualified =
elementFormDefault.Equals(NS_LITERAL_STRING("qualified"));
elementFormDefault.EqualsLiteral("qualified");
}
}

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

@ -137,7 +137,7 @@ LoadListener::HandleEvent(nsIDOMEvent *event)
event->GetType(eventType);
if (eventType.Equals(NS_LITERAL_STRING("load"))) {
if (eventType.EqualsLiteral("load")) {
nsCOMPtr<nsIDOMDocument> document;
nsCOMPtr<nsISchema> schema;
@ -163,7 +163,7 @@ LoadListener::HandleEvent(nsIDOMEvent *event)
mListener->OnError(rv, NS_LITERAL_STRING("Failure processing schema document"));
}
}
else if (eventType.Equals(NS_LITERAL_STRING("error")) &&
else if (eventType.EqualsLiteral("error") &&
mListener) {
mListener->OnError(NS_ERROR_SCHEMA_LOADING_ERROR,
NS_LITERAL_STRING("Failure loading"));
@ -228,8 +228,8 @@ nsBuiltinSchemaCollection::GetAttribute(const nsAString & aName,
static PRBool
IsSchemaNamespace(const nsAString& aNamespace)
{
if (aNamespace.Equals(NS_LITERAL_STRING(NS_SCHEMA_2001_NAMESPACE)) ||
aNamespace.Equals(NS_LITERAL_STRING(NS_SCHEMA_1999_NAMESPACE))) {
if (aNamespace.EqualsLiteral(NS_SCHEMA_2001_NAMESPACE) ||
aNamespace.EqualsLiteral(NS_SCHEMA_1999_NAMESPACE)) {
return PR_TRUE;
}
else {
@ -240,8 +240,8 @@ IsSchemaNamespace(const nsAString& aNamespace)
static PRBool
IsSOAPNamespace(const nsAString& aNamespace)
{
if (aNamespace.Equals(NS_LITERAL_STRING(NS_SOAP_1_1_ENCODING_NAMESPACE)) ||
aNamespace.Equals(NS_LITERAL_STRING(NS_SOAP_1_2_ENCODING_NAMESPACE))) {
if (aNamespace.EqualsLiteral(NS_SOAP_1_1_ENCODING_NAMESPACE) ||
aNamespace.EqualsLiteral(NS_SOAP_1_2_ENCODING_NAMESPACE)) {
return PR_TRUE;
}
else {
@ -446,7 +446,7 @@ nsBuiltinSchemaCollection::GetSOAPType(const nsAString& aName,
rv = CallQueryInterface(sup, aType);
}
else {
if (aName.Equals(NS_LITERAL_STRING("Array"))) {
if (aName.EqualsLiteral("Array")) {
nsCOMPtr<nsISchemaType> anyType;
rv = GetBuiltinType(NS_LITERAL_STRING("anyType"),
NS_LITERAL_STRING(NS_SCHEMA_2001_NAMESPACE),
@ -465,7 +465,7 @@ nsBuiltinSchemaCollection::GetSOAPType(const nsAString& aName,
*aType = array;
NS_ADDREF(*aType);
}
else if (aName.Equals(NS_LITERAL_STRING("arrayType"))) {
else if (aName.EqualsLiteral("arrayType")) {
nsSOAPArrayType* arrayType = new nsSOAPArrayType();
if (!arrayType) {
return NS_ERROR_OUT_OF_MEMORY;
@ -985,7 +985,7 @@ nsSchemaLoader::ProcessElement(nsSchema* aSchema,
value.Trim(" \r\n\t");
PRInt32 flags = 0;
if (value.Equals(NS_LITERAL_STRING("true")))
if (value.EqualsLiteral("true"))
flags |= nsSchemaElement::NILLABLE;
rv = aElement->GetAttributeNS(empty, NS_LITERAL_STRING("abstract"), value);
@ -993,7 +993,7 @@ nsSchemaLoader::ProcessElement(nsSchema* aSchema,
return rv;
value.Trim(" \r\n\t");
if (value.Equals(NS_LITERAL_STRING("true")))
if (value.EqualsLiteral("true"))
flags |= nsSchemaElement::ABSTRACT;
nsCOMPtr<nsIDOMNode> parent;
@ -1012,7 +1012,7 @@ nsSchemaLoader::ProcessElement(nsSchema* aSchema,
// elementFormDefault on the <schema> ancestor is qualified, then the
// actual value of the targetNamespace [attribute] is that of the ancestor
// <schema> element information item, or absent if there is none.
if (value.Equals(NS_LITERAL_STRING("schema"))) {
if (value.EqualsLiteral("schema")) {
flags |= nsSchemaElement::FORM_QUALIFIED;
}
else {
@ -1029,7 +1029,7 @@ nsSchemaLoader::ProcessElement(nsSchema* aSchema,
flags &= ~nsSchemaElement::FORM_QUALIFIED;
}
}
else if (value.Equals(NS_LITERAL_STRING("qualified"))) {
else if (value.EqualsLiteral("qualified")) {
flags |= nsSchemaElement::FORM_QUALIFIED;
}
else {
@ -1122,7 +1122,7 @@ nsSchemaLoader::ProcessComplexType(nsSchema* aSchema,
nsSchemaComplexType* typeInst;
typeInst = new nsSchemaComplexType(aSchema, name,
abstract.Equals(NS_LITERAL_STRING("true")));
abstract.EqualsLiteral("true"));
if (!typeInst) {
return NS_ERROR_OUT_OF_MEMORY;
}
@ -1174,7 +1174,7 @@ nsSchemaLoader::ProcessComplexType(nsSchema* aSchema,
nsAutoString mixed;
aElement->GetAttribute(NS_LITERAL_STRING("mixed"), mixed);
if (mixed.Equals(NS_LITERAL_STRING("true"))) {
if (mixed.EqualsLiteral("true")) {
contentModel = nsISchemaComplexType::CONTENT_MODEL_MIXED;
}
@ -1833,7 +1833,7 @@ nsSchemaLoader::ProcessComplexContent(nsSchema* aSchema,
nsAutoString mixed;
aElement->GetAttribute(NS_LITERAL_STRING("mixed"), mixed);
if (mixed.Equals(NS_LITERAL_STRING("true"))) {
if (mixed.EqualsLiteral("true")) {
*aContentModel = nsISchemaComplexType::CONTENT_MODEL_MIXED;
}
@ -2590,13 +2590,13 @@ nsSchemaLoader::ProcessFacet(nsSchema* aSchema,
}
else if (aTagName == nsSchemaAtoms::sWhiteSpace_atom) {
PRUint16 whiteSpaceVal;
if (valueStr.Equals(NS_LITERAL_STRING("collapse"))) {
if (valueStr.EqualsLiteral("collapse")) {
whiteSpaceVal = nsSchemaFacet::WHITESPACE_COLLAPSE;
}
else if (valueStr.Equals(NS_LITERAL_STRING("preserve"))) {
else if (valueStr.EqualsLiteral("preserve")) {
whiteSpaceVal = nsSchemaFacet::WHITESPACE_PRESERVE;
}
else if (valueStr.Equals(NS_LITERAL_STRING("replace"))) {
else if (valueStr.EqualsLiteral("replace")) {
whiteSpaceVal = nsSchemaFacet::WHITESPACE_REPLACE;
}
else {
@ -2611,7 +2611,7 @@ nsSchemaLoader::ProcessFacet(nsSchema* aSchema,
nsAutoString isFixed;
aElement->GetAttribute(NS_LITERAL_STRING("fixed"), isFixed);
facetInst->SetIsFixed(isFixed.Equals(NS_LITERAL_STRING("true")));
facetInst->SetIsFixed(isFixed.EqualsLiteral("true"));
*aFacet = facet;
NS_ADDREF(*aFacet);
@ -2628,10 +2628,10 @@ nsSchemaLoader::GetUse(nsIDOMElement* aElement,
nsAutoString use;
aElement->GetAttribute(NS_LITERAL_STRING("use"), use);
if (use.Equals(NS_LITERAL_STRING("prohibited"))) {
if (use.EqualsLiteral("prohibited")) {
*aUse = nsISchemaAttribute::USE_PROHIBITED;
}
else if (use.Equals(NS_LITERAL_STRING("required"))) {
else if (use.EqualsLiteral("required")) {
*aUse = nsISchemaAttribute::USE_REQUIRED;
}
}
@ -2645,10 +2645,10 @@ nsSchemaLoader::GetProcess(nsIDOMElement* aElement,
nsAutoString process;
aElement->GetAttribute(NS_LITERAL_STRING("process"), process);
if (process.Equals(NS_LITERAL_STRING("lax"))) {
if (process.EqualsLiteral("lax")) {
*aProcess = nsISchemaAnyParticle::PROCESS_LAX;
}
else if (process.Equals(NS_LITERAL_STRING("skip"))) {
else if (process.EqualsLiteral("skip")) {
*aProcess = nsISchemaAnyParticle::PROCESS_SKIP;
}
}
@ -2674,7 +2674,7 @@ nsSchemaLoader::GetMinAndMax(nsIDOMElement* aElement,
}
if (!maxStr.IsEmpty()) {
if (maxStr.Equals(NS_LITERAL_STRING("unbounded"))) {
if (maxStr.EqualsLiteral("unbounded")) {
*aMaxOccurs = nsISchemaParticle::OCCURRENCE_UNBOUNDED;
}
else {

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

@ -393,7 +393,7 @@ nsWSDLLoadRequest::HandleEvent(nsIDOMEvent *event)
event->GetType(eventType);
if (eventType.Equals(NS_LITERAL_STRING("load"))) {
if (eventType.EqualsLiteral("load")) {
nsCOMPtr<nsIDOMDocument> document;
rv = mRequest->GetResponseXML(getter_AddRefs(document));
@ -456,7 +456,7 @@ nsWSDLLoadRequest::HandleEvent(nsIDOMEvent *event)
return NS_OK;
}
}
else if (eventType.Equals(NS_LITERAL_STRING("error"))) {
else if (eventType.EqualsLiteral("error")) {
mListener->OnError(NS_ERROR_WSDL_LOADING_ERROR,
NS_LITERAL_STRING("Failure loading"));
return NS_OK;
@ -641,8 +641,8 @@ nsWSDLLoadRequest::GetSchemaType(const nsAString& aName,
const nsAString& aNamespace,
nsISchemaType** aSchemaComponent)
{
if (aNamespace.Equals(NS_LITERAL_STRING(SCHEMA_2001_NAMESPACE)) ||
aNamespace.Equals(NS_LITERAL_STRING(SCHEMA_1999_NAMESPACE))) {
if (aNamespace.EqualsLiteral(SCHEMA_2001_NAMESPACE) ||
aNamespace.EqualsLiteral(SCHEMA_1999_NAMESPACE)) {
nsCOMPtr<nsISchemaCollection> collection(do_QueryInterface(mSchemaLoader));
return collection->GetType(aName, aNamespace, aSchemaComponent);
}
@ -1148,7 +1148,7 @@ nsWSDLLoadRequest::ProcessMessageBinding(nsIDOMElement* aElement,
childElement->GetAttribute(NS_LITERAL_STRING("namespace"), namespaceStr);
PRUint16 use = nsISOAPPartBinding::USE_LITERAL;
if (useStr.Equals(NS_LITERAL_STRING("encoded"))) {
if (useStr.EqualsLiteral("encoded")) {
use = nsISOAPPartBinding::USE_ENCODED;
}
@ -1270,10 +1270,10 @@ nsWSDLLoadRequest::ProcessOperationBinding(nsIDOMElement* aElement,
childElement->GetAttribute(NS_LITERAL_STRING("style"), style);
bindingInst->SetSoapAction(action);
if (style.Equals(NS_LITERAL_STRING("rpc"))) {
if (style.EqualsLiteral("rpc")) {
bindingInst->SetStyle(nsISOAPPortBinding::STYLE_RPC);
}
else if (style.Equals(NS_LITERAL_STRING("document"))) {
else if (style.EqualsLiteral("document")) {
bindingInst->SetStyle(nsISOAPPortBinding::STYLE_DOCUMENT);
}
// If one isn't explicitly specified, we inherit from the port
@ -1394,10 +1394,10 @@ nsWSDLLoadRequest::ProcessBindingElement(nsIDOMElement* aElement)
childElement->GetAttribute(NS_LITERAL_STRING("style"), style);
childElement->GetAttribute(NS_LITERAL_STRING("transport"), transport);
if (style.Equals(NS_LITERAL_STRING("rpc"))) {
if (style.EqualsLiteral("rpc")) {
bindingInst->SetStyle(nsISOAPPortBinding::STYLE_RPC);
}
else if (style.Equals(NS_LITERAL_STRING("document"))) {
else if (style.EqualsLiteral("document")) {
bindingInst->SetStyle(nsISOAPPortBinding::STYLE_DOCUMENT);
}
bindingInst->SetTransport(transport);

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

@ -157,7 +157,7 @@ nsMultipartProxyListener::OnStartRequest(nsIRequest *aRequest,
nsCAutoString contentType;
nsresult rv = channel->GetContentType(contentType);
if (!contentType.Equals(NS_LITERAL_CSTRING("multipart/x-mixed-replace"))) {
if (!contentType.EqualsLiteral("multipart/x-mixed-replace")) {
return NS_ERROR_INVALID_ARG;
}
@ -504,7 +504,7 @@ nsXMLHttpRequest::ConvertBodyToText(nsAString& aOutBuffer)
}
}
if (dataCharset.Equals(NS_LITERAL_CSTRING("ASCII"))) {
if (dataCharset.EqualsLiteral("ASCII")) {
CopyASCIItoUTF16(mResponseBody, aOutBuffer);
return NS_OK;
@ -1380,7 +1380,7 @@ nsXMLHttpRequest::Send(nsIVariant *aBody)
httpChannel->GetRequestMethod(method); // If GET, method name will be uppercase
}
if (aBody && httpChannel && !method.Equals(NS_LITERAL_CSTRING("GET"))) {
if (aBody && httpChannel && !method.EqualsLiteral("GET")) {
nsXPIDLString serial;
nsCOMPtr<nsIInputStream> postDataStream;

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

@ -199,9 +199,9 @@ nsLSParser::AddEventListener(const nsAString& aType,
{
nsCOMArray<nsIDOMEventListener> *listeners;
if (aType.Equals(NS_LITERAL_STRING("ls-load"))) {
if (aType.EqualsLiteral("ls-load")) {
listeners = &mLoadListeners;
} else if (aType.Equals(NS_LITERAL_STRING("ls-progress"))) {
} else if (aType.EqualsLiteral("ls-progress")) {
listeners = &mProgressListeners;
} else {
// Not a supported event
@ -223,9 +223,9 @@ nsLSParser::RemoveEventListener(const nsAString& aType,
{
nsCOMArray<nsIDOMEventListener> *listeners;
if (aType.Equals(NS_LITERAL_STRING("ls-load"))) {
if (aType.EqualsLiteral("ls-load")) {
listeners = &mLoadListeners;
} else if (aType.Equals(NS_LITERAL_STRING("ls-progress"))) {
} else if (aType.EqualsLiteral("ls-progress")) {
listeners = &mProgressListeners;
} else {
// Not a supported event

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

@ -193,7 +193,7 @@ NS_IMETHODIMP mozLineTerm::ArePrefsSecure(PRBool *_retval)
XMLT_LOG(mozLineTerm::ArePrefsSecure,32,
("secLevelString=%s\n", secLevelString.get()));
*_retval = secLevelString.Equals(NS_LITERAL_CSTRING("sameOrigin"));
*_retval = secLevelString.EqualsLiteral("sameOrigin");
if (!(*_retval)) {
XMLT_ERROR("mozLineTerm::ArePrefsSecure: Error - Please add the line\n"

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

@ -1029,7 +1029,7 @@ NS_IMETHODIMP mozXMLTermSession::ReadAll(mozILineTermAux* lineTermAux,
XMLT_LOG(mozXMLTermSession::ReadAll,62,("metaCommandOutput\n"));
// Ignore the string "false", if that's the only output
if (metaCommandOutput.Equals(NS_LITERAL_STRING("false")))
if (metaCommandOutput.EqualsLiteral("false"))
metaCommandOutput.SetLength(0);
// Check metacommand output for markup (secure)

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

@ -484,15 +484,15 @@ GetEncoding(const nsCString& aFontName, nsACString& aValue)
// see if we should init the property
if (! gFontEncodingProperties) {
// but bail out for common fonts used at startup...
if (aFontName.Equals(NS_LITERAL_CSTRING("Lucida Grande")) ||
aFontName.Equals(NS_LITERAL_CSTRING("Charcoal")) ||
aFontName.Equals(NS_LITERAL_CSTRING("Chicago")) ||
aFontName.Equals(NS_LITERAL_CSTRING("Capitals")) ||
aFontName.Equals(NS_LITERAL_CSTRING("Gadget")) ||
aFontName.Equals(NS_LITERAL_CSTRING("Sand")) ||
aFontName.Equals(NS_LITERAL_CSTRING("Techno")) ||
aFontName.Equals(NS_LITERAL_CSTRING("Textile")) ||
aFontName.Equals(NS_LITERAL_CSTRING("Geneva")) )
if (aFontName.EqualsLiteral("Lucida Grande") ||
aFontName.EqualsLiteral("Charcoal") ||
aFontName.EqualsLiteral("Chicago") ||
aFontName.EqualsLiteral("Capitals") ||
aFontName.EqualsLiteral("Gadget") ||
aFontName.EqualsLiteral("Sand") ||
aFontName.EqualsLiteral("Techno") ||
aFontName.EqualsLiteral("Textile") ||
aFontName.EqualsLiteral("Geneva") )
return NS_ERROR_NOT_AVAILABLE; // error mean do not get a special encoding
// init the property now

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

@ -1292,20 +1292,20 @@ PRBool
nsFontMetricsOS2::GetVectorSubstitute(HPS aPS, const nsAString& aFamilyname,
nsAString& aAlias)
{
if (aFamilyname.Equals(NS_LITERAL_STRING("Tms Rmn"))) {
if (aFamilyname.EqualsLiteral("Tms Rmn")) {
aAlias = NS_LITERAL_STRING("Times New Roman");
} else if (aFamilyname.Equals(NS_LITERAL_STRING("Helv"))) {
} else if (aFamilyname.EqualsLiteral("Helv")) {
aAlias = NS_LITERAL_STRING("Helvetica");
}
// When printing, substitute vector fonts for these common bitmap fonts
if (!mDeviceContext->SupportsRasterFonts()) {
if (aFamilyname.Equals(NS_LITERAL_STRING("System Proportional")) ||
aFamilyname.Equals(NS_LITERAL_STRING("WarpSans")))
if (aFamilyname.EqualsLiteral("System Proportional") ||
aFamilyname.EqualsLiteral("WarpSans"))
{
aAlias = NS_LITERAL_STRING("Helvetica");
} else if (aFamilyname.Equals(NS_LITERAL_STRING("System Monospaced")) ||
aFamilyname.Equals(NS_LITERAL_STRING("System VIO")))
} else if (aFamilyname.EqualsLiteral("System Monospaced") ||
aFamilyname.EqualsLiteral("System VIO"))
{
aAlias = NS_LITERAL_STRING("Courier");
}

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

@ -135,7 +135,7 @@ nsNativeTheme::CheckBooleanAttr(nsIFrame* aFrame, nsIAtom* aAtom)
// string "true" to be counted as true. An empty string should _not_
// be counted as true.
return attr.Equals(NS_LITERAL_STRING("true"));
return attr.EqualsLiteral("true");
}
PRInt32

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

@ -105,7 +105,7 @@ class nsNativeTheme
PRBool IsSortReversed(nsIFrame* aFrame) {
nsAutoString sortdir;
if (GetAttr(aFrame, mSortDirectionAtom, sortdir))
return sortdir.Equals(NS_LITERAL_STRING("descending"));
return sortdir.EqualsLiteral("descending");
return PR_FALSE;
}
@ -121,7 +121,7 @@ class nsNativeTheme
PRBool IsIndeterminateProgress(nsIFrame* aFrame) {
nsAutoString mode;
if (GetAttr(aFrame, mModeAtom, mode))
return mode.Equals(NS_LITERAL_STRING("undetermined"));
return mode.EqualsLiteral("undetermined");
return PR_FALSE;
}

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

@ -384,7 +384,7 @@ CheckForPrintToFile(nsIPrintSettings* aPS, LPTSTR aPrinterName, PRUnichar* aUPri
aPS->GetToFileName(getter_Copies(toFileName));
if (toFileName) {
if (*toFileName) {
if (toFileName.Equals(NS_LITERAL_STRING("FILE:"))) {
if (toFileName.EqualsLiteral("FILE:")) {
// this skips the setting of the "print to file" info below
// which we don't want to do.
return NS_OK;

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

@ -300,11 +300,11 @@ NS_IMETHODIMP nsMetaCharsetObserver::Notify(
if(NS_SUCCEEDED(res2))
{
// following charset should have been detected by parser
if (!preferred.Equals(NS_LITERAL_CSTRING("UTF-16")) &&
!preferred.Equals(NS_LITERAL_CSTRING("UTF-16BE")) &&
!preferred.Equals(NS_LITERAL_CSTRING("UTF-16LE")) &&
!preferred.Equals(NS_LITERAL_CSTRING("UTF-32BE")) &&
!preferred.Equals(NS_LITERAL_CSTRING("UTF-32LE"))) {
if (!preferred.EqualsLiteral("UTF-16") &&
!preferred.EqualsLiteral("UTF-16BE") &&
!preferred.EqualsLiteral("UTF-16LE") &&
!preferred.EqualsLiteral("UTF-32BE") &&
!preferred.EqualsLiteral("UTF-32LE")) {
// Propagate the error message so that the parser can
// shutdown correctly. - Ref. Bug 96440
res = NotifyWebShell(aWebShell,
@ -377,11 +377,11 @@ NS_IMETHODIMP nsMetaCharsetObserver::GetCharsetFromCompatibilityTag(
// the BOM detection.
nsString* currentCharset = values->StringAt(numOfAttributes-3);
if (!preferred.Equals(NS_LossyConvertUCS2toASCII(*currentCharset)) &&
!preferred.Equals(NS_LITERAL_CSTRING("UTF-16")) &&
!preferred.Equals(NS_LITERAL_CSTRING("UTF-16BE")) &&
!preferred.Equals(NS_LITERAL_CSTRING("UTF-16LE")) &&
!preferred.Equals(NS_LITERAL_CSTRING("UTF-32BE")) &&
!preferred.Equals(NS_LITERAL_CSTRING("UTF-32LE")))
!preferred.EqualsLiteral("UTF-16") &&
!preferred.EqualsLiteral("UTF-16BE") &&
!preferred.EqualsLiteral("UTF-16LE") &&
!preferred.EqualsLiteral("UTF-32BE") &&
!preferred.EqualsLiteral("UTF-32LE"))
AppendASCIItoUTF16(preferred, aCharset);
}
}

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

@ -183,11 +183,11 @@ nsLanguageAtomService::LookupLanguage(const PRUnichar* aLanguage,
NS_ENSURE_TRUE(language, NS_ERROR_OUT_OF_MEMORY);
nsXPIDLString langGroupStr;
if (lowered.Equals(NS_LITERAL_STRING("en-us"))) {
if (lowered.EqualsLiteral("en-us")) {
langGroupStr.Assign(NS_LITERAL_STRING("x-western"));
} else if (lowered.Equals(NS_LITERAL_STRING("de-de"))) {
} else if (lowered.EqualsLiteral("de-de")) {
langGroupStr.Assign(NS_LITERAL_STRING("x-western"));
} else if (lowered.Equals(NS_LITERAL_STRING("ja-jp"))) {
} else if (lowered.EqualsLiteral("ja-jp")) {
langGroupStr.Assign(NS_LITERAL_STRING("ja"));
} else {
if (!mLangGroups) {

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

@ -840,15 +840,15 @@ posixlocale_reverse_conversion_test()
//
result = posix_locale->GetXPLocale("en_US",locale);
NS_ASSERTION(NS_SUCCEEDED(result),"nsLocaleTest: GetXPLocale failed.\n");
NS_ASSERTION(locale.Equals(NS_LITERAL_STRING("en-US")),"nsLocaleTest: GetXPLocale failed.\n");
NS_ASSERTION(locale.EqualsLiteral("en-US"),"nsLocaleTest: GetXPLocale failed.\n");
result = posix_locale->GetXPLocale("C",locale);
NS_ASSERTION(NS_SUCCEEDED(result),"nsLocaleTest: GetXPLocale failed.\n");
NS_ASSERTION(locale.Equals(NS_LITERAL_STRING("en")),"nsLocaleTest: GetXPLocale failed.\n");
NS_ASSERTION(locale.EqualsLiteral("en"),"nsLocaleTest: GetXPLocale failed.\n");
result = posix_locale->GetXPLocale("en",locale);
NS_ASSERTION(NS_SUCCEEDED(result),"nsLocaleTest: GetXPLocale failed.\n");
NS_ASSERTION(locale.Equals(NS_LITERAL_STRING("en")),"nsLocaleTest: GetXPLocale failed.\n");
NS_ASSERTION(locale.EqualsLiteral("en"),"nsLocaleTest: GetXPLocale failed.\n");
posix_locale->Release();

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

@ -90,25 +90,25 @@ nsresult
nsLWBreakerFImp::GetBreaker(const nsAString& aParam, nsILineBreaker** oResult)
{
nsJISx4051LineBreaker *result;
if( aParam.Equals(NS_LITERAL_STRING("ja")) )
if( aParam.EqualsLiteral("ja") )
{
result = new nsJISx4051LineBreaker (
gJaNoBegin, sizeof(gJaNoBegin)/sizeof(PRUnichar),
gJaNoEnd, sizeof(gJaNoEnd)/sizeof(PRUnichar));
}
else if(aParam.Equals(NS_LITERAL_STRING("ko")))
else if(aParam.EqualsLiteral("ko"))
{
result = new nsJISx4051LineBreaker (
gKoNoBegin, sizeof(gKoNoBegin)/sizeof(PRUnichar),
gKoNoEnd, sizeof(gKoNoEnd)/sizeof(PRUnichar));
}
else if(aParam.Equals(NS_LITERAL_STRING("tw")))
else if(aParam.EqualsLiteral("tw"))
{
result = new nsJISx4051LineBreaker (
gTwNoBegin, sizeof(gTwNoBegin)/sizeof(PRUnichar),
gTwNoEnd, sizeof(gTwNoEnd)/sizeof(PRUnichar));
}
else if(aParam.Equals(NS_LITERAL_STRING("cn")))
else if(aParam.EqualsLiteral("cn"))
{
result = new nsJISx4051LineBreaker (
gCnNoBegin, sizeof(gCnNoBegin)/sizeof(PRUnichar),

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

@ -79,18 +79,18 @@ NS_IMETHODIMP nsCharsetAlias2::GetPreferred(const nsACString& aAlias,
// function *while loading* charsetalias.properties (see bug 190951),
// so we might have an |mDelegate| already that isn't valid yet, but
// the load is guaranteed to be "UTF-8" so things will be OK.
if(aKey.Equals(NS_LITERAL_CSTRING("utf-8"))) {
if(aKey.EqualsLiteral("utf-8")) {
oResult = NS_LITERAL_CSTRING("UTF-8");
NS_TIMELINE_STOP_TIMER("nsCharsetAlias2:GetPreferred");
return NS_OK;
}
if(aKey.Equals(NS_LITERAL_CSTRING("iso-8859-1"))) {
if(aKey.EqualsLiteral("iso-8859-1")) {
oResult = NS_LITERAL_CSTRING("ISO-8859-1");
NS_TIMELINE_STOP_TIMER("nsCharsetAlias2:GetPreferred");
return NS_OK;
}
if(aKey.Equals(NS_LITERAL_CSTRING("x-sjis")) ||
aKey.Equals(NS_LITERAL_CSTRING("shift_jis"))) {
if(aKey.EqualsLiteral("x-sjis") ||
aKey.EqualsLiteral("shift_jis")) {
oResult = NS_LITERAL_CSTRING("Shift_JIS");
NS_TIMELINE_STOP_TIMER("nsCharsetAlias2:GetPreferred");
return NS_OK;

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

@ -98,12 +98,12 @@ nsresult
nsPlatformCharset::MapToCharset(nsAString& inANSICodePage, nsACString& outCharset)
{
//delay loading os2charset.properties bundle if possible
if (inANSICodePage.Equals(NS_LITERAL_STRING("os2.850"))) {
if (inANSICodePage.EqualsLiteral("os2.850")) {
outCharset = NS_LITERAL_CSTRING("IBM850");
return NS_OK;
}
if (inANSICodePage.Equals(NS_LITERAL_STRING("os2.932"))) {
if (inANSICodePage.EqualsLiteral("os2.932")) {
outCharset = NS_LITERAL_CSTRING("Shift_JIS");
return NS_OK;
}

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

@ -92,12 +92,12 @@ nsresult
nsPlatformCharset::MapToCharset(nsAString& inANSICodePage, nsACString& outCharset)
{
//delay loading wincharset.properties bundle if possible
if (inANSICodePage.Equals(NS_LITERAL_STRING("acp.1252"))) {
if (inANSICodePage.EqualsLiteral("acp.1252")) {
outCharset = NS_LITERAL_CSTRING("windows-1252");
return NS_OK;
}
if (inANSICodePage.Equals(NS_LITERAL_STRING("acp.932"))) {
if (inANSICodePage.EqualsLiteral("acp.932")) {
outCharset = NS_LITERAL_CSTRING("Shift_JIS");
return NS_OK;
}

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

@ -2820,7 +2820,7 @@ DocumentViewerImpl::GetPopupLinkNode(nsIDOMNode** aNode)
}
}
}
if (anchor || area || link || xlinkType.Equals(NS_LITERAL_STRING("simple"))) {
if (anchor || area || link || xlinkType.EqualsLiteral("simple")) {
*aNode = node;
NS_IF_ADDREF(*aNode); // addref
return NS_OK;

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

@ -814,7 +814,7 @@ nsCSSDeclaration::TryBorderShorthand(nsAString & aString, PRUint32 aPropertiesSe
nsAutoString valueString;
AppendValueToString(eCSSProperty_border_top_color, valueString);
if (!valueString.Equals(NS_LITERAL_STRING("-moz-use-text-color"))) {
if (!valueString.EqualsLiteral("-moz-use-text-color")) {
/* don't output this value, it's proprietary Mozilla and */
/* not intended to be exposed ; we can remove it from the */
/* values of the shorthand since this value represents the */
@ -848,7 +848,7 @@ nsCSSDeclaration::TryBorderSideShorthand(nsAString & aString,
nsAutoString valueString;
AppendValueToString(OrderValueAt(aBorderColor-1), valueString);
if (!valueString.Equals(NS_LITERAL_STRING("-moz-use-text-color"))) {
if (!valueString.EqualsLiteral("-moz-use-text-color")) {
aString.Append(NS_LITERAL_STRING(" "));
aString.Append(valueString);
}

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше