diff --git a/mozilla/content/base/src/nsDocument.cpp b/mozilla/content/base/src/nsDocument.cpp index 6b0f249fc26..f08a584b2e0 100644 --- a/mozilla/content/base/src/nsDocument.cpp +++ b/mozilla/content/base/src/nsDocument.cpp @@ -2692,7 +2692,7 @@ PRBool nsDocument::SetProperty(JSContext *aContext, JSObject *aObj, jsval aID mPropName.Assign(JS_GetStringChars(JS_ValueToString(aContext, aID))); if (mPropName.Length() > 2) mPrefix.Assign(mPropName.GetUnicode(), 2); - if (mPrefix == "on") { + if (mPrefix.Equals("on")) { nsCOMPtr atom = getter_AddRefs(NS_NewAtom(mPropName)); nsIEventListenerManager *mManager = nsnull; diff --git a/mozilla/content/base/src/nsDocumentEncoder.cpp b/mozilla/content/base/src/nsDocumentEncoder.cpp index a88798c9954..a1de491b977 100644 --- a/mozilla/content/base/src/nsDocumentEncoder.cpp +++ b/mozilla/content/base/src/nsDocumentEncoder.cpp @@ -173,7 +173,7 @@ nsTextEncoder::EncodeToString(nsString& aOutputString) { nsString buffer; - if (mMimeType == "text/xif") + if (mMimeType.Equals("text/xif")) { mDocument->CreateXIF(aOutputString, mSelection); return NS_OK; @@ -192,7 +192,7 @@ nsTextEncoder::EncodeToString(nsString& aOutputString) { nsIHTMLContentSink* sink = nsnull; - if (mMimeType == "text/html") + if (mMimeType.Equals("text/html")) rv = NS_New_HTML_ContentSinkStream(&sink, &aOutputString, mFlags); else // default to text/plain @@ -249,7 +249,7 @@ nsTextEncoder::EncodeToStream(nsIOutputStream* aStream) if (NS_SUCCEEDED(rv)) { nsIHTMLContentSink* sink = nsnull; - if (mMimeType == "text/html") + if (mMimeType.Equals("text/html")) rv = NS_New_HTML_ContentSinkStream(&sink, aStream, charset, mFlags); else diff --git a/mozilla/content/base/src/nsGenericElement.cpp b/mozilla/content/base/src/nsGenericElement.cpp index 8e57a97ff54..617d01cc039 100644 --- a/mozilla/content/base/src/nsGenericElement.cpp +++ b/mozilla/content/base/src/nsGenericElement.cpp @@ -1296,7 +1296,7 @@ nsGenericElement::SetProperty(JSContext *aContext, JSObject *aObj, jsval aID, js propName.Assign(JS_GetStringChars(JS_ValueToString(aContext, aID))); if (propName.Length() > 2) prefix.Assign(propName.GetUnicode(), 2); - if (prefix == "on") { + if (prefix.Equals("on")) { nsCOMPtr atom = getter_AddRefs(NS_NewAtom(propName)); nsIEventListenerManager *manager = nsnull; diff --git a/mozilla/content/events/src/nsEventStateManager.cpp b/mozilla/content/events/src/nsEventStateManager.cpp index e38f135c9bb..48dd730dd44 100644 --- a/mozilla/content/events/src/nsEventStateManager.cpp +++ b/mozilla/content/events/src/nsEventStateManager.cpp @@ -1802,7 +1802,7 @@ nsEventStateManager::GetNextTabbableContent(nsIContent* aParent, nsIContent* aCh if (focusable) { nsAutoString value; child->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::disabled, value); - if (value != "true") + if (!value.Equals("true")) disabled = PR_FALSE; } } diff --git a/mozilla/content/html/content/src/nsHTMLInputElement.cpp b/mozilla/content/html/content/src/nsHTMLInputElement.cpp index 3886cd840a5..0af8e852f0b 100644 --- a/mozilla/content/html/content/src/nsHTMLInputElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLInputElement.cpp @@ -557,7 +557,7 @@ nsHTMLInputElement::GetChecked(PRBool* aValue) } } - if (value == "1") + if (value.Equals("1")) *aValue = PR_TRUE; else *aValue = PR_FALSE; diff --git a/mozilla/content/html/content/src/nsHTMLOptionElement.cpp b/mozilla/content/html/content/src/nsHTMLOptionElement.cpp index 2aae9a5fe59..ff6dc018b9b 100644 --- a/mozilla/content/html/content/src/nsHTMLOptionElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLOptionElement.cpp @@ -260,7 +260,7 @@ nsHTMLOptionElement::GetSelected(PRBool* aValue) nsString value; value.Append(indx, 10); // Save the index in base 10 formControlFrame->GetProperty(nsHTMLAtoms::selected, value); - if (value == "1") + if (value.Equals("1")) *aValue = PR_TRUE; else *aValue = PR_FALSE; diff --git a/mozilla/content/html/document/src/nsHTMLContentSink.cpp b/mozilla/content/html/document/src/nsHTMLContentSink.cpp index 9abeb3fb297..5fcf1193cf6 100644 --- a/mozilla/content/html/document/src/nsHTMLContentSink.cpp +++ b/mozilla/content/html/document/src/nsHTMLContentSink.cpp @@ -3557,7 +3557,7 @@ HTMLContentSink::ProcessStyleLink(nsIHTMLContent* aElement, if (0 == mimeType.Length()) { nsString extension; aHref.Right(extension, 4); - if (extension == ".css") { + if (extension.Equals(".css")) { isStyleSheet = PR_TRUE; // strict mode + no mime type + '.css' extension } } diff --git a/mozilla/content/html/document/src/nsHTMLDocument.cpp b/mozilla/content/html/document/src/nsHTMLDocument.cpp index dfba2150e54..fdfd485f07b 100644 --- a/mozilla/content/html/document/src/nsHTMLDocument.cpp +++ b/mozilla/content/html/document/src/nsHTMLDocument.cpp @@ -431,7 +431,7 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand, NS_RELEASE(lastModKey); if (NS_SUCCEEDED(rv)) { - lastModified = lastModHeader; + lastModified.Assign(lastModHeader); SetLastModified(lastModified); } @@ -445,7 +445,7 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand, NS_RELEASE(referrerKey); if (NS_SUCCEEDED(rv)) { - referrer = referrerHeader; + referrer.Assign(referrerHeader); SetReferrer(referrer); } @@ -457,7 +457,7 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand, NS_RELEASE(contentTypeKey); if (NS_SUCCEEDED(rv)) { nsAutoString contentType; - contentType = contenttypeheader; + contentType.Assign(contenttypeheader); PRInt32 start = contentType.RFind("charset=", PR_TRUE ) ; if(kNotFound != start) { diff --git a/mozilla/content/xbl/src/nsXBLBinding.cpp b/mozilla/content/xbl/src/nsXBLBinding.cpp index e917b6a805f..e8bf0adf745 100644 --- a/mozilla/content/xbl/src/nsXBLBinding.cpp +++ b/mozilla/content/xbl/src/nsXBLBinding.cpp @@ -405,7 +405,7 @@ nsXBLBinding::GenerateAnonymousContent(nsIContent* aBoundElement) // in the excludes list. nsAutoString excludes; content->GetAttribute(kNameSpaceID_None, kExcludesAtom, excludes); - if (excludes != "*") { + if (!excludes.Equals("*")) { if (!excludes.IsEmpty()) { // Walk the children and ensure that all of them // are in the excludes array. @@ -450,7 +450,7 @@ nsXBLBinding::GenerateAnonymousContent(nsIContent* aBoundElement) nsCOMPtr attr(do_QueryInterface(attribute)); nsAutoString name; attr->GetName(name); - if (name != "excludes") { + if (!name.Equals("excludes")) { nsAutoString value; nsCOMPtr element(do_QueryInterface(mBoundElement)); element->GetAttribute(name, value); @@ -504,7 +504,7 @@ nsXBLBinding::InstallEventHandlers(nsIContent* aBoundElement) nsAutoString type; child->GetAttribute(kNameSpaceID_None, kTypeAtom, type); - if (type != "") { + if (!type.IsEmpty()) { nsCOMPtr eventAtom = getter_AddRefs(NS_NewAtom(type)); PRBool found = PR_FALSE; nsIID iid; @@ -526,7 +526,7 @@ nsXBLBinding::InstallEventHandlers(nsIContent* aBoundElement) PRBool useCapture = PR_FALSE; nsAutoString capturer; child->GetAttribute(kNameSpaceID_None, kCapturerAtom, capturer); - if (capturer == "true") + if (capturer.Equals("true")) useCapture = PR_TRUE; // Add the event listener. @@ -569,7 +569,7 @@ nsXBLBinding::GetBaseTag(nsIAtom** aResult) nsAutoString extends; mBinding->GetAttribute(kNameSpaceID_None, kExtendsAtom, extends); - if (extends != "") { + if (!extends.IsEmpty()) { // Obtain the namespace prefix. nsAutoString prefix; PRInt32 offset = extends.FindChar(kNameSpaceSeparator); @@ -657,7 +657,7 @@ nsXBLBinding::AttributeChanged(nsIAtom* aAttribute, PRInt32 aNameSpaceID, PRBool // Construct a new text node and insert it. nsAutoString value; nsresult result = mBoundElement->GetAttribute(aNameSpaceID, aAttribute, value); - if (value != "") { + if (!value.IsEmpty()) { nsCOMPtr textNode; nsCOMPtr doc; mBoundElement->GetDocument(*getter_AddRefs(doc)); @@ -731,7 +731,7 @@ nsXBLBinding::IsInExcludesList(nsIAtom* aTag, const nsString& aList) nsAutoString element; aTag->ToString(element); - if (aList == "*") + if (aList.Equals("*")) return PR_TRUE; // match _everything_! PRInt32 indx = aList.Find(element); @@ -762,7 +762,7 @@ nsXBLBinding::ConstructAttributeTable(nsIContent* aElement) // ability to map one attribute to another. nsAutoString inherits; aElement->GetAttribute(kNameSpaceID_None, kInheritsAtom, inherits); - if (inherits != "") { + if (!inherits.IsEmpty()) { if (!mAttributeTable) { mAttributeTable = new nsSupportsHashtable(8); } @@ -825,7 +825,7 @@ nsXBLBinding::ConstructAttributeTable(nsIContent* aElement) aElement->SetAttribute(kNameSpaceID_None, attribute, value, PR_TRUE); nsCOMPtr tag; aElement->GetTag(*getter_AddRefs(tag)); - if ((tag.get() == kHTMLAtom) && (attribute.get() == kValueAtom) && value != "") { + if ((tag.get() == kHTMLAtom) && (attribute.get() == kValueAtom) && !value.IsEmpty()) { nsCOMPtr textNode; nsCOMPtr doc; mBoundElement->GetDocument(*getter_AddRefs(doc)); @@ -873,21 +873,21 @@ nsXBLBinding::GetEventHandlerIID(nsIAtom* aName, nsIID* aIID, PRBool* aFound) PRBool nsXBLBinding::IsMouseHandler(const nsString& aName) { - return ((aName == "click") || (aName == "dblclick") || (aName=="mousedown") || - (aName == "mouseover") || (aName == "mouseout") || (aName == "mouseup")); + return ((aName.Equals("click")) || (aName.Equals("dblclick")) || (aName.Equals("mousedown")) || + (aName.Equals("mouseover")) || (aName.Equals("mouseout")) || (aName.Equals("mouseup"))); } PRBool nsXBLBinding::IsKeyHandler(const nsString& aName) { - return ((aName == "keypress") || (aName == "keydown") || (aName == "keyup")); + return ((aName.Equals("keypress")) || (aName.Equals("keydown")) || (aName.Equals("keyup"))); } PRBool nsXBLBinding::IsXULHandler(const nsString& aName) { - return ((aName == "create") || (aName == "destroy") || (aName=="broadcast") || - (aName == "command") || (aName == "commandupdate") || (aName == "close")); + return ((aName.Equals("create")) || (aName.Equals("destroy")) || (aName.Equals("broadcast")) || + (aName.Equals("command")) || (aName.Equals("commandupdate")) || (aName.Equals("close"))); } NS_IMETHODIMP diff --git a/mozilla/content/xbl/src/nsXBLEventHandler.cpp b/mozilla/content/xbl/src/nsXBLEventHandler.cpp index 00e46f585c7..ead14f8a341 100644 --- a/mozilla/content/xbl/src/nsXBLEventHandler.cpp +++ b/mozilla/content/xbl/src/nsXBLEventHandler.cpp @@ -101,7 +101,7 @@ nsresult nsXBLEventHandler::HandleEvent(nsIDOMEvent* aEvent) nsresult nsXBLEventHandler::KeyUp(nsIDOMEvent* aKeyEvent) { - if (mEventName != "keyup") + if (!mEventName.Equals("keyup")) return NS_OK; nsCOMPtr keyEvent = do_QueryInterface(aKeyEvent); @@ -112,7 +112,7 @@ nsresult nsXBLEventHandler::KeyUp(nsIDOMEvent* aKeyEvent) nsresult nsXBLEventHandler::KeyDown(nsIDOMEvent* aKeyEvent) { - if (mEventName != "keydown") + if (!mEventName.Equals("keydown")) return NS_OK; nsCOMPtr keyEvent = do_QueryInterface(aKeyEvent); @@ -123,7 +123,7 @@ nsresult nsXBLEventHandler::KeyDown(nsIDOMEvent* aKeyEvent) nsresult nsXBLEventHandler::KeyPress(nsIDOMEvent* aKeyEvent) { - if (mEventName != "keypress") + if (!mEventName.Equals("keypress")) return NS_OK; nsCOMPtr keyEvent = do_QueryInterface(aKeyEvent); @@ -134,7 +134,7 @@ nsresult nsXBLEventHandler::KeyPress(nsIDOMEvent* aKeyEvent) nsresult nsXBLEventHandler::MouseDown(nsIDOMEvent* aMouseEvent) { - if (mEventName != "mousedown") + if (!mEventName.Equals("mousedown")) return NS_OK; nsCOMPtr mouseEvent = do_QueryInterface(aMouseEvent); @@ -145,7 +145,7 @@ nsresult nsXBLEventHandler::MouseDown(nsIDOMEvent* aMouseEvent) nsresult nsXBLEventHandler::MouseUp(nsIDOMEvent* aMouseEvent) { - if (mEventName != "mouseup") + if (!mEventName.Equals("mouseup")) return NS_OK; nsCOMPtr mouseEvent = do_QueryInterface(aMouseEvent); @@ -156,7 +156,7 @@ nsresult nsXBLEventHandler::MouseUp(nsIDOMEvent* aMouseEvent) nsresult nsXBLEventHandler::MouseClick(nsIDOMEvent* aMouseEvent) { - if (mEventName != "click") + if (!mEventName.Equals("click")) return NS_OK; nsCOMPtr mouseEvent = do_QueryInterface(aMouseEvent); @@ -167,7 +167,7 @@ nsresult nsXBLEventHandler::MouseClick(nsIDOMEvent* aMouseEvent) nsresult nsXBLEventHandler::MouseDblClick(nsIDOMEvent* aMouseEvent) { - if (mEventName != "dblclick") + if (!mEventName.Equals("dblclick")) return NS_OK; nsCOMPtr mouseEvent = do_QueryInterface(aMouseEvent); @@ -178,7 +178,7 @@ nsresult nsXBLEventHandler::MouseDblClick(nsIDOMEvent* aMouseEvent) nsresult nsXBLEventHandler::MouseOver(nsIDOMEvent* aMouseEvent) { - if (mEventName != "mouseover") + if (!mEventName.Equals("mouseover")) return NS_OK; nsCOMPtr mouseEvent = do_QueryInterface(aMouseEvent); @@ -189,7 +189,7 @@ nsresult nsXBLEventHandler::MouseOver(nsIDOMEvent* aMouseEvent) nsresult nsXBLEventHandler::MouseOut(nsIDOMEvent* aMouseEvent) { - if (mEventName != "mouseout") + if (!mEventName.Equals("mouseout")) return NS_OK; nsCOMPtr mouseEvent = do_QueryInterface(aMouseEvent); @@ -200,7 +200,7 @@ nsresult nsXBLEventHandler::MouseOut(nsIDOMEvent* aMouseEvent) nsresult nsXBLEventHandler::Action(nsIDOMEvent* aEvent) { - if (mEventName != "command") + if (!mEventName.Equals("command")) return NS_OK; ExecuteHandler(nsAutoString("command"), aEvent); @@ -209,7 +209,7 @@ nsresult nsXBLEventHandler::Action(nsIDOMEvent* aEvent) nsresult nsXBLEventHandler::Create(nsIDOMEvent* aEvent) { - if (mEventName != "create") + if (!mEventName.Equals("create")) return NS_OK; ExecuteHandler(nsAutoString("create"), aEvent); @@ -218,7 +218,7 @@ nsresult nsXBLEventHandler::Create(nsIDOMEvent* aEvent) nsresult nsXBLEventHandler::Close(nsIDOMEvent* aEvent) { - if (mEventName != "close") + if (!mEventName.Equals("close")) return NS_OK; ExecuteHandler(nsAutoString("close"), aEvent); @@ -227,7 +227,7 @@ nsresult nsXBLEventHandler::Close(nsIDOMEvent* aEvent) nsresult nsXBLEventHandler::Broadcast(nsIDOMEvent* aEvent) { - if (mEventName != "broadcast") + if (!mEventName.Equals("broadcast")) return NS_OK; ExecuteHandler(nsAutoString("broadcast"), aEvent); @@ -236,7 +236,7 @@ nsresult nsXBLEventHandler::Broadcast(nsIDOMEvent* aEvent) nsresult nsXBLEventHandler::CommandUpdate(nsIDOMEvent* aEvent) { - if (mEventName != "commandupdate") + if (!mEventName.Equals("commandupdate")) return NS_OK; ExecuteHandler(nsAutoString("commandupdate"), aEvent); @@ -245,7 +245,7 @@ nsresult nsXBLEventHandler::CommandUpdate(nsIDOMEvent* aEvent) nsresult nsXBLEventHandler::Destroy(nsIDOMEvent* aEvent) { - if (mEventName != "destroy") + if (!mEventName.Equals("destroy")) return NS_OK; ExecuteHandler(nsAutoString("destroy"), aEvent); diff --git a/mozilla/content/xbl/src/nsXBLService.cpp b/mozilla/content/xbl/src/nsXBLService.cpp index 38801f40a3b..f73a1dce99f 100644 --- a/mozilla/content/xbl/src/nsXBLService.cpp +++ b/mozilla/content/xbl/src/nsXBLService.cpp @@ -340,7 +340,7 @@ NS_IMETHODIMP nsXBLService::GetBinding(nsCAutoString& aURLStr, nsIXBLBinding** a { *aResult = nsnull; - if (aURLStr == nsCAutoString("")) + if (aURLStr.IsEmpty()) return NS_ERROR_FAILURE; nsCOMPtr uri; @@ -379,7 +379,7 @@ NS_IMETHODIMP nsXBLService::GetBinding(nsCAutoString& aURLStr, nsIXBLBinding** a child->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::name, value); // If no ref is specified just use this. - if ((bindingName == "") || (bindingName == value)) { + if ((bindingName.IsEmpty()) || (bindingName == value)) { // Make a new binding NS_NewXBLBinding(aResult); @@ -388,7 +388,7 @@ NS_IMETHODIMP nsXBLService::GetBinding(nsCAutoString& aURLStr, nsIXBLBinding** a // Check for the presence of an extends attribute child->GetAttribute(kNameSpaceID_None, kExtendsAtom, value); - if (value != "") { + if (!value.IsEmpty()) { // See if we are extending a builtin tag. nsCOMPtr tag; (*aResult)->GetBaseTag(getter_AddRefs(tag)); @@ -538,7 +538,7 @@ nsXBLService::StripWhitespaceNodes(nsIContent* aElement) nsAutoString result; text->CopyText(result); result.StripWhitespace(); - if (result == "") { + if (result.IsEmpty()) { // This node contained nothing but whitespace. // Remove it from the content model. aElement->RemoveChildAt(i, PR_TRUE); diff --git a/mozilla/content/xml/document/src/nsXMLContentSink.cpp b/mozilla/content/xml/document/src/nsXMLContentSink.cpp index ffc6f92c8bd..16c30d16132 100644 --- a/mozilla/content/xml/document/src/nsXMLContentSink.cpp +++ b/mozilla/content/xml/document/src/nsXMLContentSink.cpp @@ -1960,7 +1960,7 @@ nsXMLContentSink::GetElementFactory(PRInt32 aNameSpaceID, nsIElementFactory** aR gNameSpaceManager->GetNameSpaceURI(aNameSpaceID, nameSpace); nsCAutoString progID = NS_ELEMENT_FACTORY_PROGID_PREFIX; - progID += nameSpace; + progID.Append(nameSpace); // Retrieve the appropriate factory. NS_WITH_SERVICE(nsIElementFactory, elementFactory, progID, &rv); diff --git a/mozilla/content/xml/document/src/nsXMLDocument.cpp b/mozilla/content/xml/document/src/nsXMLDocument.cpp index 2ffde668ce9..8896f72d138 100644 --- a/mozilla/content/xml/document/src/nsXMLDocument.cpp +++ b/mozilla/content/xml/document/src/nsXMLDocument.cpp @@ -276,7 +276,7 @@ nsXMLDocument::StartDocumentLoad(const char* aCommand, NS_RELEASE(contentTypeKey); if (NS_SUCCEEDED(rv)) { nsAutoString contentType; - contentType = contenttypeheader; + contentType.Assign(contenttypeheader); PRInt32 start = contentType.RFind("charset=", PR_TRUE ) ; if(kNotFound != start) { diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index 31985a5bb33..e2309996ace 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/base/nsCSSFrameConstructor.cpp @@ -2277,7 +2277,7 @@ nsCSSFrameConstructor::TableProcessChild(nsIPresShell* aPresShell, nsString charData; domData->GetData(charData); charData = charData.StripWhitespace(); - if ((charData.Length() <= 0) && (charData != " ")) { // XXX check this + if ((charData.Length() <= 0) && (!charData.Equals(" "))) { // XXX check this needCell = PR_FALSE; // only contains whitespace, don't create cell } NS_RELEASE(domData); @@ -4326,7 +4326,7 @@ nsCSSFrameConstructor::CreateAnonymousFrames(nsIPresShell* aPresShell, const nsStyleUserInterface* ui= (const nsStyleUserInterface*) styleContext->GetStyleData(eStyleStruct_UserInterface); - if (ui->mBehavior != "") { + if (!ui->mBehavior.IsEmpty()) { // Get the XBL loader. nsresult rv; NS_WITH_SERVICE(nsIXBLService, xblService, "component://netscape/xbl", &rv); @@ -4489,7 +4489,7 @@ nsCSSFrameConstructor::CreateAnonymousTreeCellFrames(nsIPresShell* aPresS const nsStyleUserInterface* ui= (const nsStyleUserInterface*) styleContext->GetStyleData(eStyleStruct_UserInterface); - if (ui->mBehavior != "") { + if (!ui->mBehavior.IsEmpty()) { // Get the XBL loader. nsresult rv; NS_WITH_SERVICE(nsIXBLService, xblService, "component://netscape/xbl", &rv); @@ -4577,7 +4577,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresShell* aPresShell, aStyleContext->GetStyleData(eStyleStruct_UserInterface); // Ensure that our XBL bindings are installed. - if (ui->mBehavior != "") { + if (!ui->mBehavior.IsEmpty()) { // Get the XBL loader. nsresult rv; NS_WITH_SERVICE(nsIXBLService, xblService, "component://netscape/xbl", &rv); diff --git a/mozilla/layout/base/src/nsDocument.cpp b/mozilla/layout/base/src/nsDocument.cpp index 6b0f249fc26..f08a584b2e0 100644 --- a/mozilla/layout/base/src/nsDocument.cpp +++ b/mozilla/layout/base/src/nsDocument.cpp @@ -2692,7 +2692,7 @@ PRBool nsDocument::SetProperty(JSContext *aContext, JSObject *aObj, jsval aID mPropName.Assign(JS_GetStringChars(JS_ValueToString(aContext, aID))); if (mPropName.Length() > 2) mPrefix.Assign(mPropName.GetUnicode(), 2); - if (mPrefix == "on") { + if (mPrefix.Equals("on")) { nsCOMPtr atom = getter_AddRefs(NS_NewAtom(mPropName)); nsIEventListenerManager *mManager = nsnull; diff --git a/mozilla/layout/base/src/nsDocumentEncoder.cpp b/mozilla/layout/base/src/nsDocumentEncoder.cpp index a88798c9954..a1de491b977 100644 --- a/mozilla/layout/base/src/nsDocumentEncoder.cpp +++ b/mozilla/layout/base/src/nsDocumentEncoder.cpp @@ -173,7 +173,7 @@ nsTextEncoder::EncodeToString(nsString& aOutputString) { nsString buffer; - if (mMimeType == "text/xif") + if (mMimeType.Equals("text/xif")) { mDocument->CreateXIF(aOutputString, mSelection); return NS_OK; @@ -192,7 +192,7 @@ nsTextEncoder::EncodeToString(nsString& aOutputString) { nsIHTMLContentSink* sink = nsnull; - if (mMimeType == "text/html") + if (mMimeType.Equals("text/html")) rv = NS_New_HTML_ContentSinkStream(&sink, &aOutputString, mFlags); else // default to text/plain @@ -249,7 +249,7 @@ nsTextEncoder::EncodeToStream(nsIOutputStream* aStream) if (NS_SUCCEEDED(rv)) { nsIHTMLContentSink* sink = nsnull; - if (mMimeType == "text/html") + if (mMimeType.Equals("text/html")) rv = NS_New_HTML_ContentSinkStream(&sink, aStream, charset, mFlags); else diff --git a/mozilla/layout/base/src/nsGenericElement.cpp b/mozilla/layout/base/src/nsGenericElement.cpp index 8e57a97ff54..617d01cc039 100644 --- a/mozilla/layout/base/src/nsGenericElement.cpp +++ b/mozilla/layout/base/src/nsGenericElement.cpp @@ -1296,7 +1296,7 @@ nsGenericElement::SetProperty(JSContext *aContext, JSObject *aObj, jsval aID, js propName.Assign(JS_GetStringChars(JS_ValueToString(aContext, aID))); if (propName.Length() > 2) prefix.Assign(propName.GetUnicode(), 2); - if (prefix == "on") { + if (prefix.Equals("on")) { nsCOMPtr atom = getter_AddRefs(NS_NewAtom(propName)); nsIEventListenerManager *manager = nsnull; diff --git a/mozilla/layout/events/src/nsEventStateManager.cpp b/mozilla/layout/events/src/nsEventStateManager.cpp index e38f135c9bb..48dd730dd44 100644 --- a/mozilla/layout/events/src/nsEventStateManager.cpp +++ b/mozilla/layout/events/src/nsEventStateManager.cpp @@ -1802,7 +1802,7 @@ nsEventStateManager::GetNextTabbableContent(nsIContent* aParent, nsIContent* aCh if (focusable) { nsAutoString value; child->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::disabled, value); - if (value != "true") + if (!value.Equals("true")) disabled = PR_FALSE; } } diff --git a/mozilla/layout/forms/nsFormControlHelper.cpp b/mozilla/layout/forms/nsFormControlHelper.cpp index 794c1240485..97611db0cf3 100644 --- a/mozilla/layout/forms/nsFormControlHelper.cpp +++ b/mozilla/layout/forms/nsFormControlHelper.cpp @@ -111,7 +111,7 @@ void nsFormControlHelper::ForceDrawFrame(nsIPresContext* aPresContext, nsIFrame PRBool nsFormControlHelper::GetBool(const nsString& aValue) { - if (aValue == NS_STRING_TRUE) + if (aValue.Equals(NS_STRING_TRUE)) return(PR_TRUE); else return (PR_FALSE); diff --git a/mozilla/layout/forms/nsGfxButtonControlFrame.cpp b/mozilla/layout/forms/nsGfxButtonControlFrame.cpp index dfe841f54e1..2c7f3aecf6c 100644 --- a/mozilla/layout/forms/nsGfxButtonControlFrame.cpp +++ b/mozilla/layout/forms/nsGfxButtonControlFrame.cpp @@ -481,7 +481,7 @@ nsGfxButtonControlFrame::ButtonLocalize(char* aKey, nsString& oVal) nsAutoString key(aKey); rv = bundle->GetStringFromName(key.GetUnicode(), getter_Copies(valUni)); if (NS_SUCCEEDED(rv) && valUni) { - oVal = valUni; + oVal.Assign(valUni); } else { oVal.Truncate(); } diff --git a/mozilla/layout/forms/nsGfxCheckboxControlFrame.cpp b/mozilla/layout/forms/nsGfxCheckboxControlFrame.cpp index 072835ddefa..b1f766add59 100644 --- a/mozilla/layout/forms/nsGfxCheckboxControlFrame.cpp +++ b/mozilla/layout/forms/nsGfxCheckboxControlFrame.cpp @@ -549,9 +549,9 @@ nsGfxCheckboxControlFrame::CheckStateToString ( CheckState inState, nsString& ou nsGfxCheckboxControlFrame::CheckState nsGfxCheckboxControlFrame::StringToCheckState ( const nsString & aStateAsString ) { - if ( aStateAsString == NS_STRING_TRUE ) + if ( aStateAsString.Equals(NS_STRING_TRUE) ) return eOn; - else if ( aStateAsString == NS_STRING_FALSE ) + else if ( aStateAsString.Equals(NS_STRING_FALSE) ) return eOff; // not true and not false means mixed diff --git a/mozilla/layout/forms/nsGfxRadioControlFrame.cpp b/mozilla/layout/forms/nsGfxRadioControlFrame.cpp index 1c45f866b56..3421411658c 100644 --- a/mozilla/layout/forms/nsGfxRadioControlFrame.cpp +++ b/mozilla/layout/forms/nsGfxRadioControlFrame.cpp @@ -125,7 +125,7 @@ nsGfxRadioControlFrame::SetAdditionalStyleContext(PRInt32 aIndex, NS_IMETHODIMP nsGfxRadioControlFrame::SetProperty(nsIPresContext* aPresContext, nsIAtom* aName, const nsString& aValue) { if (nsHTMLAtoms::checked == aName) { - PRBool state = (aValue == NS_STRING_TRUE) ? PR_TRUE : PR_FALSE; + PRBool state = (aValue.Equals(NS_STRING_TRUE)) ? PR_TRUE : PR_FALSE; // if there is no form than the radiobtn is an orphan @@ -365,7 +365,7 @@ nsGfxRadioControlFrame::RestoreState(nsIPresContext* aPresContext, nsIPresState* mIsRestored = PR_TRUE; nsAutoString string; aState->GetStateProperty("checked", string); - PRBool state = (string == NS_STRING_TRUE) ? PR_TRUE : PR_FALSE; + PRBool state = (string.Equals(NS_STRING_TRUE)) ? PR_TRUE : PR_FALSE; SetRadioState(aPresContext, state); // sets mChecked mRestoredChecked = mChecked; diff --git a/mozilla/layout/generic/nsObjectFrame.cpp b/mozilla/layout/generic/nsObjectFrame.cpp index e8a72ac7b05..1db96d9bcb0 100644 --- a/mozilla/layout/generic/nsObjectFrame.cpp +++ b/mozilla/layout/generic/nsObjectFrame.cpp @@ -650,7 +650,7 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext, if (classid.Find("clsid:") != -1) { classid.Cut(0, 6); // Strip off the "clsid:". What's left is the class ID. - bJavaPluginClsid = (classid == JAVA_CLASS_ID); + bJavaPluginClsid = (classid.Equals(JAVA_CLASS_ID)); } // if we find "java:" in the class id, or we match the Java classid number, we have a java applet @@ -702,7 +702,7 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext, { // These are some builtin types that we know about for now. // (Eventually this will move somewhere else.) - if (classid == "browser") + if (classid.Equals("browser")) { widgetCID = kCAppShellCID; rv = InstantiateWidget(aPresContext, aMetrics, aReflowState, widgetCID); diff --git a/mozilla/layout/html/base/src/nsObjectFrame.cpp b/mozilla/layout/html/base/src/nsObjectFrame.cpp index e8a72ac7b05..1db96d9bcb0 100644 --- a/mozilla/layout/html/base/src/nsObjectFrame.cpp +++ b/mozilla/layout/html/base/src/nsObjectFrame.cpp @@ -650,7 +650,7 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext, if (classid.Find("clsid:") != -1) { classid.Cut(0, 6); // Strip off the "clsid:". What's left is the class ID. - bJavaPluginClsid = (classid == JAVA_CLASS_ID); + bJavaPluginClsid = (classid.Equals(JAVA_CLASS_ID)); } // if we find "java:" in the class id, or we match the Java classid number, we have a java applet @@ -702,7 +702,7 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext, { // These are some builtin types that we know about for now. // (Eventually this will move somewhere else.) - if (classid == "browser") + if (classid.Equals("browser")) { widgetCID = kCAppShellCID; rv = InstantiateWidget(aPresContext, aMetrics, aReflowState, widgetCID); diff --git a/mozilla/layout/html/content/src/nsHTMLInputElement.cpp b/mozilla/layout/html/content/src/nsHTMLInputElement.cpp index 3886cd840a5..0af8e852f0b 100644 --- a/mozilla/layout/html/content/src/nsHTMLInputElement.cpp +++ b/mozilla/layout/html/content/src/nsHTMLInputElement.cpp @@ -557,7 +557,7 @@ nsHTMLInputElement::GetChecked(PRBool* aValue) } } - if (value == "1") + if (value.Equals("1")) *aValue = PR_TRUE; else *aValue = PR_FALSE; diff --git a/mozilla/layout/html/content/src/nsHTMLOptionElement.cpp b/mozilla/layout/html/content/src/nsHTMLOptionElement.cpp index 2aae9a5fe59..ff6dc018b9b 100644 --- a/mozilla/layout/html/content/src/nsHTMLOptionElement.cpp +++ b/mozilla/layout/html/content/src/nsHTMLOptionElement.cpp @@ -260,7 +260,7 @@ nsHTMLOptionElement::GetSelected(PRBool* aValue) nsString value; value.Append(indx, 10); // Save the index in base 10 formControlFrame->GetProperty(nsHTMLAtoms::selected, value); - if (value == "1") + if (value.Equals("1")) *aValue = PR_TRUE; else *aValue = PR_FALSE; diff --git a/mozilla/layout/html/document/src/nsHTMLContentSink.cpp b/mozilla/layout/html/document/src/nsHTMLContentSink.cpp index 9abeb3fb297..5fcf1193cf6 100644 --- a/mozilla/layout/html/document/src/nsHTMLContentSink.cpp +++ b/mozilla/layout/html/document/src/nsHTMLContentSink.cpp @@ -3557,7 +3557,7 @@ HTMLContentSink::ProcessStyleLink(nsIHTMLContent* aElement, if (0 == mimeType.Length()) { nsString extension; aHref.Right(extension, 4); - if (extension == ".css") { + if (extension.Equals(".css")) { isStyleSheet = PR_TRUE; // strict mode + no mime type + '.css' extension } } diff --git a/mozilla/layout/html/document/src/nsHTMLDocument.cpp b/mozilla/layout/html/document/src/nsHTMLDocument.cpp index dfba2150e54..fdfd485f07b 100644 --- a/mozilla/layout/html/document/src/nsHTMLDocument.cpp +++ b/mozilla/layout/html/document/src/nsHTMLDocument.cpp @@ -431,7 +431,7 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand, NS_RELEASE(lastModKey); if (NS_SUCCEEDED(rv)) { - lastModified = lastModHeader; + lastModified.Assign(lastModHeader); SetLastModified(lastModified); } @@ -445,7 +445,7 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand, NS_RELEASE(referrerKey); if (NS_SUCCEEDED(rv)) { - referrer = referrerHeader; + referrer.Assign(referrerHeader); SetReferrer(referrer); } @@ -457,7 +457,7 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand, NS_RELEASE(contentTypeKey); if (NS_SUCCEEDED(rv)) { nsAutoString contentType; - contentType = contenttypeheader; + contentType.Assign(contenttypeheader); PRInt32 start = contentType.RFind("charset=", PR_TRUE ) ; if(kNotFound != start) { diff --git a/mozilla/layout/html/forms/src/nsFormControlHelper.cpp b/mozilla/layout/html/forms/src/nsFormControlHelper.cpp index 794c1240485..97611db0cf3 100644 --- a/mozilla/layout/html/forms/src/nsFormControlHelper.cpp +++ b/mozilla/layout/html/forms/src/nsFormControlHelper.cpp @@ -111,7 +111,7 @@ void nsFormControlHelper::ForceDrawFrame(nsIPresContext* aPresContext, nsIFrame PRBool nsFormControlHelper::GetBool(const nsString& aValue) { - if (aValue == NS_STRING_TRUE) + if (aValue.Equals(NS_STRING_TRUE)) return(PR_TRUE); else return (PR_FALSE); diff --git a/mozilla/layout/html/forms/src/nsGfxAutoTextControlFrame.cpp b/mozilla/layout/html/forms/src/nsGfxAutoTextControlFrame.cpp index bf5e947aee5..75d50807d2a 100644 --- a/mozilla/layout/html/forms/src/nsGfxAutoTextControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsGfxAutoTextControlFrame.cpp @@ -191,7 +191,7 @@ void nsGfxAutoTextControlFrame::ReadAttributes(nsIContent* aContent) if (NS_SUCCEEDED(aContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::autocompletetype, val))) { if (! val.IsEmpty()) - mUseBlurr = (val == "blurr"); + mUseBlurr = (val.Equals("blurr")); } } diff --git a/mozilla/layout/html/forms/src/nsGfxButtonControlFrame.cpp b/mozilla/layout/html/forms/src/nsGfxButtonControlFrame.cpp index dfe841f54e1..2c7f3aecf6c 100644 --- a/mozilla/layout/html/forms/src/nsGfxButtonControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsGfxButtonControlFrame.cpp @@ -481,7 +481,7 @@ nsGfxButtonControlFrame::ButtonLocalize(char* aKey, nsString& oVal) nsAutoString key(aKey); rv = bundle->GetStringFromName(key.GetUnicode(), getter_Copies(valUni)); if (NS_SUCCEEDED(rv) && valUni) { - oVal = valUni; + oVal.Assign(valUni); } else { oVal.Truncate(); } diff --git a/mozilla/layout/html/forms/src/nsGfxCheckboxControlFrame.cpp b/mozilla/layout/html/forms/src/nsGfxCheckboxControlFrame.cpp index 072835ddefa..b1f766add59 100644 --- a/mozilla/layout/html/forms/src/nsGfxCheckboxControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsGfxCheckboxControlFrame.cpp @@ -549,9 +549,9 @@ nsGfxCheckboxControlFrame::CheckStateToString ( CheckState inState, nsString& ou nsGfxCheckboxControlFrame::CheckState nsGfxCheckboxControlFrame::StringToCheckState ( const nsString & aStateAsString ) { - if ( aStateAsString == NS_STRING_TRUE ) + if ( aStateAsString.Equals(NS_STRING_TRUE) ) return eOn; - else if ( aStateAsString == NS_STRING_FALSE ) + else if ( aStateAsString.Equals(NS_STRING_FALSE) ) return eOff; // not true and not false means mixed diff --git a/mozilla/layout/html/forms/src/nsGfxRadioControlFrame.cpp b/mozilla/layout/html/forms/src/nsGfxRadioControlFrame.cpp index 1c45f866b56..3421411658c 100644 --- a/mozilla/layout/html/forms/src/nsGfxRadioControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsGfxRadioControlFrame.cpp @@ -125,7 +125,7 @@ nsGfxRadioControlFrame::SetAdditionalStyleContext(PRInt32 aIndex, NS_IMETHODIMP nsGfxRadioControlFrame::SetProperty(nsIPresContext* aPresContext, nsIAtom* aName, const nsString& aValue) { if (nsHTMLAtoms::checked == aName) { - PRBool state = (aValue == NS_STRING_TRUE) ? PR_TRUE : PR_FALSE; + PRBool state = (aValue.Equals(NS_STRING_TRUE)) ? PR_TRUE : PR_FALSE; // if there is no form than the radiobtn is an orphan @@ -365,7 +365,7 @@ nsGfxRadioControlFrame::RestoreState(nsIPresContext* aPresContext, nsIPresState* mIsRestored = PR_TRUE; nsAutoString string; aState->GetStateProperty("checked", string); - PRBool state = (string == NS_STRING_TRUE) ? PR_TRUE : PR_FALSE; + PRBool state = (string.Equals(NS_STRING_TRUE)) ? PR_TRUE : PR_FALSE; SetRadioState(aPresContext, state); // sets mChecked mRestoredChecked = mChecked; diff --git a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp index 31985a5bb33..e2309996ace 100644 --- a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -2277,7 +2277,7 @@ nsCSSFrameConstructor::TableProcessChild(nsIPresShell* aPresShell, nsString charData; domData->GetData(charData); charData = charData.StripWhitespace(); - if ((charData.Length() <= 0) && (charData != " ")) { // XXX check this + if ((charData.Length() <= 0) && (!charData.Equals(" "))) { // XXX check this needCell = PR_FALSE; // only contains whitespace, don't create cell } NS_RELEASE(domData); @@ -4326,7 +4326,7 @@ nsCSSFrameConstructor::CreateAnonymousFrames(nsIPresShell* aPresShell, const nsStyleUserInterface* ui= (const nsStyleUserInterface*) styleContext->GetStyleData(eStyleStruct_UserInterface); - if (ui->mBehavior != "") { + if (!ui->mBehavior.IsEmpty()) { // Get the XBL loader. nsresult rv; NS_WITH_SERVICE(nsIXBLService, xblService, "component://netscape/xbl", &rv); @@ -4489,7 +4489,7 @@ nsCSSFrameConstructor::CreateAnonymousTreeCellFrames(nsIPresShell* aPresS const nsStyleUserInterface* ui= (const nsStyleUserInterface*) styleContext->GetStyleData(eStyleStruct_UserInterface); - if (ui->mBehavior != "") { + if (!ui->mBehavior.IsEmpty()) { // Get the XBL loader. nsresult rv; NS_WITH_SERVICE(nsIXBLService, xblService, "component://netscape/xbl", &rv); @@ -4577,7 +4577,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresShell* aPresShell, aStyleContext->GetStyleData(eStyleStruct_UserInterface); // Ensure that our XBL bindings are installed. - if (ui->mBehavior != "") { + if (!ui->mBehavior.IsEmpty()) { // Get the XBL loader. nsresult rv; NS_WITH_SERVICE(nsIXBLService, xblService, "component://netscape/xbl", &rv); diff --git a/mozilla/layout/xbl/src/nsXBLBinding.cpp b/mozilla/layout/xbl/src/nsXBLBinding.cpp index e917b6a805f..e8bf0adf745 100644 --- a/mozilla/layout/xbl/src/nsXBLBinding.cpp +++ b/mozilla/layout/xbl/src/nsXBLBinding.cpp @@ -405,7 +405,7 @@ nsXBLBinding::GenerateAnonymousContent(nsIContent* aBoundElement) // in the excludes list. nsAutoString excludes; content->GetAttribute(kNameSpaceID_None, kExcludesAtom, excludes); - if (excludes != "*") { + if (!excludes.Equals("*")) { if (!excludes.IsEmpty()) { // Walk the children and ensure that all of them // are in the excludes array. @@ -450,7 +450,7 @@ nsXBLBinding::GenerateAnonymousContent(nsIContent* aBoundElement) nsCOMPtr attr(do_QueryInterface(attribute)); nsAutoString name; attr->GetName(name); - if (name != "excludes") { + if (!name.Equals("excludes")) { nsAutoString value; nsCOMPtr element(do_QueryInterface(mBoundElement)); element->GetAttribute(name, value); @@ -504,7 +504,7 @@ nsXBLBinding::InstallEventHandlers(nsIContent* aBoundElement) nsAutoString type; child->GetAttribute(kNameSpaceID_None, kTypeAtom, type); - if (type != "") { + if (!type.IsEmpty()) { nsCOMPtr eventAtom = getter_AddRefs(NS_NewAtom(type)); PRBool found = PR_FALSE; nsIID iid; @@ -526,7 +526,7 @@ nsXBLBinding::InstallEventHandlers(nsIContent* aBoundElement) PRBool useCapture = PR_FALSE; nsAutoString capturer; child->GetAttribute(kNameSpaceID_None, kCapturerAtom, capturer); - if (capturer == "true") + if (capturer.Equals("true")) useCapture = PR_TRUE; // Add the event listener. @@ -569,7 +569,7 @@ nsXBLBinding::GetBaseTag(nsIAtom** aResult) nsAutoString extends; mBinding->GetAttribute(kNameSpaceID_None, kExtendsAtom, extends); - if (extends != "") { + if (!extends.IsEmpty()) { // Obtain the namespace prefix. nsAutoString prefix; PRInt32 offset = extends.FindChar(kNameSpaceSeparator); @@ -657,7 +657,7 @@ nsXBLBinding::AttributeChanged(nsIAtom* aAttribute, PRInt32 aNameSpaceID, PRBool // Construct a new text node and insert it. nsAutoString value; nsresult result = mBoundElement->GetAttribute(aNameSpaceID, aAttribute, value); - if (value != "") { + if (!value.IsEmpty()) { nsCOMPtr textNode; nsCOMPtr doc; mBoundElement->GetDocument(*getter_AddRefs(doc)); @@ -731,7 +731,7 @@ nsXBLBinding::IsInExcludesList(nsIAtom* aTag, const nsString& aList) nsAutoString element; aTag->ToString(element); - if (aList == "*") + if (aList.Equals("*")) return PR_TRUE; // match _everything_! PRInt32 indx = aList.Find(element); @@ -762,7 +762,7 @@ nsXBLBinding::ConstructAttributeTable(nsIContent* aElement) // ability to map one attribute to another. nsAutoString inherits; aElement->GetAttribute(kNameSpaceID_None, kInheritsAtom, inherits); - if (inherits != "") { + if (!inherits.IsEmpty()) { if (!mAttributeTable) { mAttributeTable = new nsSupportsHashtable(8); } @@ -825,7 +825,7 @@ nsXBLBinding::ConstructAttributeTable(nsIContent* aElement) aElement->SetAttribute(kNameSpaceID_None, attribute, value, PR_TRUE); nsCOMPtr tag; aElement->GetTag(*getter_AddRefs(tag)); - if ((tag.get() == kHTMLAtom) && (attribute.get() == kValueAtom) && value != "") { + if ((tag.get() == kHTMLAtom) && (attribute.get() == kValueAtom) && !value.IsEmpty()) { nsCOMPtr textNode; nsCOMPtr doc; mBoundElement->GetDocument(*getter_AddRefs(doc)); @@ -873,21 +873,21 @@ nsXBLBinding::GetEventHandlerIID(nsIAtom* aName, nsIID* aIID, PRBool* aFound) PRBool nsXBLBinding::IsMouseHandler(const nsString& aName) { - return ((aName == "click") || (aName == "dblclick") || (aName=="mousedown") || - (aName == "mouseover") || (aName == "mouseout") || (aName == "mouseup")); + return ((aName.Equals("click")) || (aName.Equals("dblclick")) || (aName.Equals("mousedown")) || + (aName.Equals("mouseover")) || (aName.Equals("mouseout")) || (aName.Equals("mouseup"))); } PRBool nsXBLBinding::IsKeyHandler(const nsString& aName) { - return ((aName == "keypress") || (aName == "keydown") || (aName == "keyup")); + return ((aName.Equals("keypress")) || (aName.Equals("keydown")) || (aName.Equals("keyup"))); } PRBool nsXBLBinding::IsXULHandler(const nsString& aName) { - return ((aName == "create") || (aName == "destroy") || (aName=="broadcast") || - (aName == "command") || (aName == "commandupdate") || (aName == "close")); + return ((aName.Equals("create")) || (aName.Equals("destroy")) || (aName.Equals("broadcast")) || + (aName.Equals("command")) || (aName.Equals("commandupdate")) || (aName.Equals("close"))); } NS_IMETHODIMP diff --git a/mozilla/layout/xbl/src/nsXBLEventHandler.cpp b/mozilla/layout/xbl/src/nsXBLEventHandler.cpp index 00e46f585c7..ead14f8a341 100644 --- a/mozilla/layout/xbl/src/nsXBLEventHandler.cpp +++ b/mozilla/layout/xbl/src/nsXBLEventHandler.cpp @@ -101,7 +101,7 @@ nsresult nsXBLEventHandler::HandleEvent(nsIDOMEvent* aEvent) nsresult nsXBLEventHandler::KeyUp(nsIDOMEvent* aKeyEvent) { - if (mEventName != "keyup") + if (!mEventName.Equals("keyup")) return NS_OK; nsCOMPtr keyEvent = do_QueryInterface(aKeyEvent); @@ -112,7 +112,7 @@ nsresult nsXBLEventHandler::KeyUp(nsIDOMEvent* aKeyEvent) nsresult nsXBLEventHandler::KeyDown(nsIDOMEvent* aKeyEvent) { - if (mEventName != "keydown") + if (!mEventName.Equals("keydown")) return NS_OK; nsCOMPtr keyEvent = do_QueryInterface(aKeyEvent); @@ -123,7 +123,7 @@ nsresult nsXBLEventHandler::KeyDown(nsIDOMEvent* aKeyEvent) nsresult nsXBLEventHandler::KeyPress(nsIDOMEvent* aKeyEvent) { - if (mEventName != "keypress") + if (!mEventName.Equals("keypress")) return NS_OK; nsCOMPtr keyEvent = do_QueryInterface(aKeyEvent); @@ -134,7 +134,7 @@ nsresult nsXBLEventHandler::KeyPress(nsIDOMEvent* aKeyEvent) nsresult nsXBLEventHandler::MouseDown(nsIDOMEvent* aMouseEvent) { - if (mEventName != "mousedown") + if (!mEventName.Equals("mousedown")) return NS_OK; nsCOMPtr mouseEvent = do_QueryInterface(aMouseEvent); @@ -145,7 +145,7 @@ nsresult nsXBLEventHandler::MouseDown(nsIDOMEvent* aMouseEvent) nsresult nsXBLEventHandler::MouseUp(nsIDOMEvent* aMouseEvent) { - if (mEventName != "mouseup") + if (!mEventName.Equals("mouseup")) return NS_OK; nsCOMPtr mouseEvent = do_QueryInterface(aMouseEvent); @@ -156,7 +156,7 @@ nsresult nsXBLEventHandler::MouseUp(nsIDOMEvent* aMouseEvent) nsresult nsXBLEventHandler::MouseClick(nsIDOMEvent* aMouseEvent) { - if (mEventName != "click") + if (!mEventName.Equals("click")) return NS_OK; nsCOMPtr mouseEvent = do_QueryInterface(aMouseEvent); @@ -167,7 +167,7 @@ nsresult nsXBLEventHandler::MouseClick(nsIDOMEvent* aMouseEvent) nsresult nsXBLEventHandler::MouseDblClick(nsIDOMEvent* aMouseEvent) { - if (mEventName != "dblclick") + if (!mEventName.Equals("dblclick")) return NS_OK; nsCOMPtr mouseEvent = do_QueryInterface(aMouseEvent); @@ -178,7 +178,7 @@ nsresult nsXBLEventHandler::MouseDblClick(nsIDOMEvent* aMouseEvent) nsresult nsXBLEventHandler::MouseOver(nsIDOMEvent* aMouseEvent) { - if (mEventName != "mouseover") + if (!mEventName.Equals("mouseover")) return NS_OK; nsCOMPtr mouseEvent = do_QueryInterface(aMouseEvent); @@ -189,7 +189,7 @@ nsresult nsXBLEventHandler::MouseOver(nsIDOMEvent* aMouseEvent) nsresult nsXBLEventHandler::MouseOut(nsIDOMEvent* aMouseEvent) { - if (mEventName != "mouseout") + if (!mEventName.Equals("mouseout")) return NS_OK; nsCOMPtr mouseEvent = do_QueryInterface(aMouseEvent); @@ -200,7 +200,7 @@ nsresult nsXBLEventHandler::MouseOut(nsIDOMEvent* aMouseEvent) nsresult nsXBLEventHandler::Action(nsIDOMEvent* aEvent) { - if (mEventName != "command") + if (!mEventName.Equals("command")) return NS_OK; ExecuteHandler(nsAutoString("command"), aEvent); @@ -209,7 +209,7 @@ nsresult nsXBLEventHandler::Action(nsIDOMEvent* aEvent) nsresult nsXBLEventHandler::Create(nsIDOMEvent* aEvent) { - if (mEventName != "create") + if (!mEventName.Equals("create")) return NS_OK; ExecuteHandler(nsAutoString("create"), aEvent); @@ -218,7 +218,7 @@ nsresult nsXBLEventHandler::Create(nsIDOMEvent* aEvent) nsresult nsXBLEventHandler::Close(nsIDOMEvent* aEvent) { - if (mEventName != "close") + if (!mEventName.Equals("close")) return NS_OK; ExecuteHandler(nsAutoString("close"), aEvent); @@ -227,7 +227,7 @@ nsresult nsXBLEventHandler::Close(nsIDOMEvent* aEvent) nsresult nsXBLEventHandler::Broadcast(nsIDOMEvent* aEvent) { - if (mEventName != "broadcast") + if (!mEventName.Equals("broadcast")) return NS_OK; ExecuteHandler(nsAutoString("broadcast"), aEvent); @@ -236,7 +236,7 @@ nsresult nsXBLEventHandler::Broadcast(nsIDOMEvent* aEvent) nsresult nsXBLEventHandler::CommandUpdate(nsIDOMEvent* aEvent) { - if (mEventName != "commandupdate") + if (!mEventName.Equals("commandupdate")) return NS_OK; ExecuteHandler(nsAutoString("commandupdate"), aEvent); @@ -245,7 +245,7 @@ nsresult nsXBLEventHandler::CommandUpdate(nsIDOMEvent* aEvent) nsresult nsXBLEventHandler::Destroy(nsIDOMEvent* aEvent) { - if (mEventName != "destroy") + if (!mEventName.Equals("destroy")) return NS_OK; ExecuteHandler(nsAutoString("destroy"), aEvent); diff --git a/mozilla/layout/xbl/src/nsXBLService.cpp b/mozilla/layout/xbl/src/nsXBLService.cpp index 38801f40a3b..f73a1dce99f 100644 --- a/mozilla/layout/xbl/src/nsXBLService.cpp +++ b/mozilla/layout/xbl/src/nsXBLService.cpp @@ -340,7 +340,7 @@ NS_IMETHODIMP nsXBLService::GetBinding(nsCAutoString& aURLStr, nsIXBLBinding** a { *aResult = nsnull; - if (aURLStr == nsCAutoString("")) + if (aURLStr.IsEmpty()) return NS_ERROR_FAILURE; nsCOMPtr uri; @@ -379,7 +379,7 @@ NS_IMETHODIMP nsXBLService::GetBinding(nsCAutoString& aURLStr, nsIXBLBinding** a child->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::name, value); // If no ref is specified just use this. - if ((bindingName == "") || (bindingName == value)) { + if ((bindingName.IsEmpty()) || (bindingName == value)) { // Make a new binding NS_NewXBLBinding(aResult); @@ -388,7 +388,7 @@ NS_IMETHODIMP nsXBLService::GetBinding(nsCAutoString& aURLStr, nsIXBLBinding** a // Check for the presence of an extends attribute child->GetAttribute(kNameSpaceID_None, kExtendsAtom, value); - if (value != "") { + if (!value.IsEmpty()) { // See if we are extending a builtin tag. nsCOMPtr tag; (*aResult)->GetBaseTag(getter_AddRefs(tag)); @@ -538,7 +538,7 @@ nsXBLService::StripWhitespaceNodes(nsIContent* aElement) nsAutoString result; text->CopyText(result); result.StripWhitespace(); - if (result == "") { + if (result.IsEmpty()) { // This node contained nothing but whitespace. // Remove it from the content model. aElement->RemoveChildAt(i, PR_TRUE); diff --git a/mozilla/layout/xml/document/src/nsXMLContentSink.cpp b/mozilla/layout/xml/document/src/nsXMLContentSink.cpp index ffc6f92c8bd..16c30d16132 100644 --- a/mozilla/layout/xml/document/src/nsXMLContentSink.cpp +++ b/mozilla/layout/xml/document/src/nsXMLContentSink.cpp @@ -1960,7 +1960,7 @@ nsXMLContentSink::GetElementFactory(PRInt32 aNameSpaceID, nsIElementFactory** aR gNameSpaceManager->GetNameSpaceURI(aNameSpaceID, nameSpace); nsCAutoString progID = NS_ELEMENT_FACTORY_PROGID_PREFIX; - progID += nameSpace; + progID.Append(nameSpace); // Retrieve the appropriate factory. NS_WITH_SERVICE(nsIElementFactory, elementFactory, progID, &rv); diff --git a/mozilla/layout/xml/document/src/nsXMLDocument.cpp b/mozilla/layout/xml/document/src/nsXMLDocument.cpp index 2ffde668ce9..8896f72d138 100644 --- a/mozilla/layout/xml/document/src/nsXMLDocument.cpp +++ b/mozilla/layout/xml/document/src/nsXMLDocument.cpp @@ -276,7 +276,7 @@ nsXMLDocument::StartDocumentLoad(const char* aCommand, NS_RELEASE(contentTypeKey); if (NS_SUCCEEDED(rv)) { nsAutoString contentType; - contentType = contenttypeheader; + contentType.Assign(contenttypeheader); PRInt32 start = contentType.RFind("charset=", PR_TRUE ) ; if(kNotFound != start) { diff --git a/mozilla/layout/xul/base/src/nsGrippyFrame.cpp b/mozilla/layout/xul/base/src/nsGrippyFrame.cpp index 7c6138be844..011d0a5eaf0 100644 --- a/mozilla/layout/xul/base/src/nsGrippyFrame.cpp +++ b/mozilla/layout/xul/base/src/nsGrippyFrame.cpp @@ -91,7 +91,7 @@ nsGrippyFrame::MouseClicked(nsIPresContext* aPresContext) nsString value; if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsXULAtoms::state, value)) { - if (value=="collapsed") + if (value.Equals("collapsed")) a = "open"; } diff --git a/mozilla/layout/xul/base/src/nsMenuBarFrame.cpp b/mozilla/layout/xul/base/src/nsMenuBarFrame.cpp index 48731cb90dc..c900c472961 100644 --- a/mozilla/layout/xul/base/src/nsMenuBarFrame.cpp +++ b/mozilla/layout/xul/base/src/nsMenuBarFrame.cpp @@ -611,7 +611,7 @@ nsMenuBarFrame::IsDisabled(nsIContent* aContent) { nsString disabled = ""; aContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::disabled, disabled); - if (disabled == "true") + if (disabled.Equals("true")) return PR_TRUE; return PR_FALSE; } diff --git a/mozilla/layout/xul/base/src/nsMenuFrame.cpp b/mozilla/layout/xul/base/src/nsMenuFrame.cpp index 453171e7535..97dd05a4174 100644 --- a/mozilla/layout/xul/base/src/nsMenuFrame.cpp +++ b/mozilla/layout/xul/base/src/nsMenuFrame.cpp @@ -233,7 +233,7 @@ nsMenuFrame::GetFrameForPoint(nsIPresContext* aPresContext, // This allows selective overriding for subcontent. nsAutoString value; content->GetAttribute(kNameSpaceID_None, nsXULAtoms::allowevents, value); - if (value == "true") + if (value.Equals("true")) return result; } const nsStyleDisplay* disp = (const nsStyleDisplay*) @@ -407,7 +407,7 @@ PRBool nsMenuFrame::IsGenerated() if (child) { nsString genVal; child->GetAttribute(kNameSpaceID_None, nsXULAtoms::menugenerated, genVal); - if (genVal == "") + if (genVal.IsEmpty()) return PR_FALSE; } @@ -426,7 +426,7 @@ nsMenuFrame::MarkAsGenerated() if (child) { nsAutoString genVal; child->GetAttribute(kNameSpaceID_None, nsXULAtoms::menugenerated, genVal); - if (genVal == "") + if (genVal.IsEmpty()) child->SetAttribute(kNameSpaceID_None, nsXULAtoms::menugenerated, "true", PR_TRUE); } @@ -468,7 +468,7 @@ nsMenuFrame::AttributeChanged(nsIPresContext* aPresContext, if (aAttribute == nsXULAtoms::open) { aChild->GetAttribute(kNameSpaceID_None, aAttribute, value); - if (value == "true") + if (value.Equals("true")) OpenMenuInternal(PR_TRUE); else OpenMenuInternal(PR_FALSE); @@ -572,15 +572,15 @@ nsMenuFrame::OpenMenuInternal(PRBool aActivateFlag) if (onMenuBar) { - if (popupAnchor == "") + if (popupAnchor.IsEmpty()) popupAnchor = "bottomleft"; - if (popupAlign == "") + if (popupAlign.IsEmpty()) popupAlign = "topleft"; } else { - if (popupAnchor == "") + if (popupAnchor.IsEmpty()) popupAnchor = "topright"; - if (popupAlign == "") + if (popupAlign.IsEmpty()) popupAlign = "topleft"; } @@ -837,15 +837,15 @@ nsMenuFrame::DidReflow(nsIPresContext* aPresContext, mMenuParent->IsMenuBar(onMenuBar); if (onMenuBar) { - if (popupAnchor == "") + if (popupAnchor.IsEmpty()) popupAnchor = "bottomleft"; - if (popupAlign == "") + if (popupAlign.IsEmpty()) popupAlign = "topleft"; } else { - if (popupAnchor == "") + if (popupAnchor.IsEmpty()) popupAnchor = "topright"; - if (popupAlign == "") + if (popupAlign.IsEmpty()) popupAlign = "topleft"; } @@ -945,7 +945,7 @@ nsMenuFrame::Notify(nsITimer* aTimer) if (!mMenuOpen && mMenuParent) { nsAutoString active = ""; mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::menuactive, active); - if (active == "true") { + if (active.Equals("true")) { // We're still the active menu. OpenMenu(PR_TRUE); } @@ -962,7 +962,7 @@ nsMenuFrame::IsDisabled() { nsAutoString disabled; mContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::disabled, disabled); - if (disabled == "true") + if (disabled.Equals("true")) return PR_TRUE; return PR_FALSE; } @@ -972,9 +972,9 @@ nsMenuFrame::UpdateMenuType(nsIPresContext* aPresContext) { nsAutoString value; mContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::type, value); - if (value == "checkbox") + if (value.Equals("checkbox")) mType = eMenuType_Checkbox; - else if (value == "radio") { + else if (value.Equals("radio")) { mType = eMenuType_Radio; nsAutoString value; @@ -999,7 +999,7 @@ nsMenuFrame::UpdateMenuSpecialState(nsIPresContext* aPresContext) { mContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::checked, value); - newChecked = (value == "true"); + newChecked = (value.Equals("true")); if (newChecked == mChecked) { /* checked state didn't change */ @@ -1093,7 +1093,7 @@ nsMenuFrame::BuildAcceleratorText(nsString& aAccelString) { nsString accelText; mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::acceltext, accelText); - if (accelText != "") { + if (!accelText.IsEmpty()) { // Just use this. aAccelString = accelText; return; @@ -1137,7 +1137,7 @@ nsMenuFrame::BuildAcceleratorText(nsString& aAccelString) nsAutoString xulkey; keyElement->GetAttribute(nsAutoString("xulkey"), xulkey); - if (xulkey == "true") { + if (xulkey.Equals("true")) { // Set the default for the xul key modifier #ifdef XP_MAC commandValue = "true"; @@ -1150,24 +1150,24 @@ nsMenuFrame::BuildAcceleratorText(nsString& aAccelString) PRBool prependPlus = PR_FALSE; - if(commandValue != "" && commandValue != "false") { + if(!commandValue.IsEmpty() && !commandValue.Equals("false")) { prependPlus = PR_TRUE; aAccelString += "Ctrl"; // Hmmm. Kinda defeats the point of having an abstraction. } - if(controlValue != "" && controlValue != "false") { + if(!controlValue.IsEmpty() && !controlValue.Equals("false")) { prependPlus = PR_TRUE; aAccelString += "Ctrl"; } - if(shiftValue != "" && shiftValue != "false") { + if(!shiftValue.IsEmpty() && !shiftValue.Equals("false")) { if (prependPlus) aAccelString += "+"; prependPlus = PR_TRUE; aAccelString += "Shift"; } - if (altValue != "" && altValue != "false") { + if (!altValue.IsEmpty() && !altValue.Equals("false")) { if (prependPlus) aAccelString += "+"; prependPlus = PR_TRUE; @@ -1175,14 +1175,14 @@ nsMenuFrame::BuildAcceleratorText(nsString& aAccelString) } keyChar.ToUpperCase(); - if (keyChar != "") { + if (!keyChar.IsEmpty()) { if (prependPlus) aAccelString += "+"; prependPlus = PR_TRUE; aAccelString += keyChar; } - if (aAccelString != "") + if (!aAccelString.IsEmpty()) mContent->SetAttribute(kNameSpaceID_None, nsXULAtoms::acceltext, aAccelString, PR_FALSE); } diff --git a/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp b/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp index fdf99996e7d..a9fab278e91 100644 --- a/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp +++ b/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp @@ -319,35 +319,35 @@ nsMenuPopupFrame :: AdjustPositionForAnchorAlign ( PRInt32* ioXPos, PRInt32* ioY const nsString& aPopupAnchor, const nsString& aPopupAlign, PRBool* outFlushWithTopBottom ) { - if (aPopupAnchor == "topright" && aPopupAlign == "topleft") { + if (aPopupAnchor.Equals("topright") && aPopupAlign.Equals("topleft")) { *ioXPos += inParentRect.width; } - else if (aPopupAnchor == "topright" && aPopupAlign == "bottomright") { + else if (aPopupAnchor.Equals("topright") && aPopupAlign.Equals("bottomright")) { *ioXPos -= (mRect.width - inParentRect.width); *ioYPos -= mRect.height; *outFlushWithTopBottom = PR_TRUE; } - else if (aPopupAnchor == "bottomright" && aPopupAlign == "bottomleft") { + else if (aPopupAnchor.Equals("bottomright") && aPopupAlign.Equals("bottomleft")) { *ioXPos += inParentRect.width; *ioYPos -= (mRect.height - inParentRect.height); } - else if (aPopupAnchor == "bottomright" && aPopupAlign == "topright") { + else if (aPopupAnchor.Equals("bottomright") && aPopupAlign.Equals("topright")) { *ioXPos -= (mRect.width - inParentRect.width); *ioYPos += inParentRect.height; *outFlushWithTopBottom = PR_TRUE; } - else if (aPopupAnchor == "topleft" && aPopupAlign == "topright") { + else if (aPopupAnchor.Equals("topleft") && aPopupAlign.Equals("topright")) { *ioXPos -= mRect.width; } - else if (aPopupAnchor == "topleft" && aPopupAlign == "bottomleft") { + else if (aPopupAnchor.Equals("topleft") && aPopupAlign.Equals("bottomleft")) { *ioYPos -= mRect.height; *outFlushWithTopBottom = PR_TRUE; } - else if (aPopupAnchor == "bottomleft" && aPopupAlign == "bottomright") { + else if (aPopupAnchor.Equals("bottomleft") && aPopupAlign.Equals("bottomright")) { *ioXPos -= mRect.width; *ioYPos -= (mRect.height - inParentRect.height); } - else if (aPopupAnchor == "bottomleft" && aPopupAlign == "topleft") { + else if (aPopupAnchor.Equals("bottomleft") && aPopupAlign.Equals("topleft")) { *ioYPos += inParentRect.height; *outFlushWithTopBottom = PR_TRUE; } @@ -709,7 +709,7 @@ nsMenuPopupFrame::SyncViewWithFrame(nsIPresContext* aPresContext, nsAutoString shouldDisplay, menuActive; mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::menuactive, menuActive); - if (menuActive != "true") { + if (!menuActive.Equals("true")) { mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::menutobedisplayed, shouldDisplay); if ( shouldDisplay.Equals("true") ) mContent->SetAttribute(kNameSpaceID_None, nsXULAtoms::menuactive, "true", PR_TRUE); @@ -1221,7 +1221,7 @@ nsMenuPopupFrame::IsDisabled(nsIContent* aContent) { nsString disabled = ""; aContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::disabled, disabled); - if (disabled == "true") + if (disabled.Equals("true")) return PR_TRUE; return PR_FALSE; } diff --git a/mozilla/layout/xul/base/src/nsPopupSetFrame.cpp b/mozilla/layout/xul/base/src/nsPopupSetFrame.cpp index 20101bb4d15..de1a72c4f3e 100644 --- a/mozilla/layout/xul/base/src/nsPopupSetFrame.cpp +++ b/mozilla/layout/xul/base/src/nsPopupSetFrame.cpp @@ -336,9 +336,9 @@ nsPopupSetFrame::DidReflow(nsIPresContext* aPresContext, menuPopupContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::popupanchor, popupAnchor); menuPopupContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::popupalign, popupAlign); - if (popupAnchor == "") + if (popupAnchor.IsEmpty()) popupAnchor = "bottomleft"; - if (popupAlign == "") + if (popupAlign.IsEmpty()) popupAlign = "topleft"; ((nsMenuPopupFrame*)activeChild)->SyncViewWithFrame(aPresContext, popupAnchor, popupAlign, mElementFrame, mXPos, mYPos); @@ -442,7 +442,7 @@ nsPopupSetFrame::CreatePopup(nsIFrame* aElementFrame, nsIContent* aPopupContent, // determine if this menu is a context menu and flag it nsIFrame* activeChild = GetActiveChild(); nsCOMPtr childPopup ( do_QueryInterface(activeChild) ); - if ( childPopup && aPopupType == "context" ) + if ( childPopup && aPopupType.Equals("context") ) childPopup->SetIsContextMenu(PR_TRUE); // Now we'll have it in our child frame list. @@ -482,7 +482,7 @@ nsPopupSetFrame::MarkAsGenerated(nsIContent* aPopupContent) nsAutoString value; childContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::menugenerated, value); - if (value == "true") { + if (value.Equals("true")) { // Ungenerate this element. childContent->UnsetAttribute(kNameSpaceID_None, nsXULAtoms::menugenerated, PR_TRUE); @@ -494,7 +494,7 @@ nsPopupSetFrame::MarkAsGenerated(nsIContent* aPopupContent) nsAutoString value; aPopupContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::menugenerated, value); - if (value != "true") { + if (!value.Equals("true")) { // Generate this element. aPopupContent->SetAttribute(kNameSpaceID_None, nsXULAtoms::menugenerated, "true", PR_TRUE); diff --git a/mozilla/layout/xul/base/src/nsSliderFrame.cpp b/mozilla/layout/xul/base/src/nsSliderFrame.cpp index be00123938a..c720cce32ce 100644 --- a/mozilla/layout/xul/base/src/nsSliderFrame.cpp +++ b/mozilla/layout/xul/base/src/nsSliderFrame.cpp @@ -295,7 +295,7 @@ nsSliderFrame::IsHorizontal(nsIContent* scrollbar) nsAutoString value; if (NS_CONTENT_ATTR_HAS_VALUE == scrollbar->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::align, value)) { - if (value=="vertical") + if (value.Equals("vertical")) isHorizontal = PR_FALSE; } diff --git a/mozilla/layout/xul/base/src/nsTitledButtonFrame.cpp b/mozilla/layout/xul/base/src/nsTitledButtonFrame.cpp index fbd3e822c6e..210e19f262b 100644 --- a/mozilla/layout/xul/base/src/nsTitledButtonFrame.cpp +++ b/mozilla/layout/xul/base/src/nsTitledButtonFrame.cpp @@ -294,7 +294,7 @@ nsTitledButtonFrame::Init(nsIPresContext* aPresContext, nsAutoString accesskey; mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::accesskey, accesskey); - if (accesskey != "") { + if (!accesskey.IsEmpty()) { mAccesskeyIndex = mTitle.Find(accesskey, PR_TRUE); if (mAccesskeyIndex == -1) { nsString tmpstring = "(" ; @@ -808,7 +808,7 @@ nsTitledButtonFrame::UpdateAccessUnderline() nsAutoString accesskey; mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::accesskey, accesskey); - if (accesskey == "") + if (accesskey.IsEmpty()) return; // our work here is done mAccesskeyIndex = mCroppedTitle.Find(accesskey, PR_TRUE); @@ -1280,9 +1280,9 @@ nsTitledButtonFrame::MouseClicked (nsIPresContext* aPresContext) nsTitledButtonFrame::CheckState nsTitledButtonFrame :: StringToCheckState ( const nsString & aStateAsString ) { - if ( aStateAsString == NS_STRING_TRUE ) + if ( aStateAsString.Equals(NS_STRING_TRUE) ) return eOn; - else if ( aStateAsString == NS_STRING_FALSE ) + else if ( aStateAsString.Equals(NS_STRING_FALSE) ) return eOff; // not true and not false means mixed diff --git a/mozilla/layout/xul/base/src/nsToolboxFrame.cpp b/mozilla/layout/xul/base/src/nsToolboxFrame.cpp index 1edbc83e4f0..1b61744b96a 100644 --- a/mozilla/layout/xul/base/src/nsToolboxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsToolboxFrame.cpp @@ -458,7 +458,7 @@ nsToolboxFrame::CalculateGrippies(nsIPresContext* aPresContext) value = ""; childContent->GetAttribute(kNameSpaceID_None, kCollapsedAtom, value); - if (value == "true") { // The bar is collapsed! + if (value.Equals("true")) { // The bar is collapsed! nscoord grippyWidth; nscoord grippyHeight; diff --git a/mozilla/layout/xul/base/src/nsTreeCellFrame.cpp b/mozilla/layout/xul/base/src/nsTreeCellFrame.cpp index c842d827c72..48789d6cee7 100644 --- a/mozilla/layout/xul/base/src/nsTreeCellFrame.cpp +++ b/mozilla/layout/xul/base/src/nsTreeCellFrame.cpp @@ -84,7 +84,7 @@ nsTreeCellFrame::Init(nsIPresContext* aPresContext, nsresult result = aContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::allowevents, attrValue); attrValue.ToLowerCase(); PRBool allowEvents = (result == NS_CONTENT_ATTR_NO_VALUE || - (result == NS_CONTENT_ATTR_HAS_VALUE && attrValue=="true")); + (result == NS_CONTENT_ATTR_HAS_VALUE && attrValue.Equals("true"))); SetAllowEvents(allowEvents); // Determine if we're a column header or not. @@ -171,7 +171,7 @@ nsTreeCellFrame::GetFrameForPoint(nsIPresContext* aPresContext, // This allows selective overriding for subcontent. nsAutoString value; content->GetAttribute(kNameSpaceID_None, nsXULAtoms::allowevents, value); - if (value == "true") + if (value.Equals("true")) return result; } } @@ -356,7 +356,7 @@ nsTreeCellFrame::ToggleOpenClose() nsAutoString attrValue; treeItem->GetAttribute("open", attrValue); attrValue.ToLowerCase(); - PRBool isExpanded = (attrValue=="true"); + PRBool isExpanded = (attrValue.Equals("true")); if (isExpanded) { // We're collapsing and need to remove frames from the flow. @@ -391,7 +391,7 @@ nsTreeCellFrame::Open() nsAutoString attrValue; treeItem->GetAttribute("open", attrValue); attrValue.ToLowerCase(); - PRBool isExpanded = (attrValue=="true"); + PRBool isExpanded = (attrValue.Equals("true")); if (!isExpanded) { // We're expanding and need to add frames to the flow. treeItem->SetAttribute("open", "true"); @@ -420,7 +420,7 @@ nsTreeCellFrame::Close() nsAutoString attrValue; treeItem->GetAttribute("open", attrValue); attrValue.ToLowerCase(); - PRBool isExpanded = (attrValue=="true"); + PRBool isExpanded = (attrValue.Equals("true")); if (isExpanded) { // We're expanding and need to add frames to the flow. treeItem->RemoveAttribute("open"); diff --git a/mozilla/layout/xul/base/src/nsTreeFrame.cpp b/mozilla/layout/xul/base/src/nsTreeFrame.cpp index 83836b7e4fe..a5c9d3648fa 100644 --- a/mozilla/layout/xul/base/src/nsTreeFrame.cpp +++ b/mozilla/layout/xul/base/src/nsTreeFrame.cpp @@ -491,7 +491,7 @@ nsTreeFrame::Init(nsIPresContext* aPresContext, nsCOMPtr element = do_QueryInterface(mContent); element->GetAttribute("rows", value); - if (value != "") { + if (!value.IsEmpty()) { PRInt32 dummy; PRInt32 count = value.ToInteger(&dummy); mFixedRows = count; @@ -512,7 +512,7 @@ nsTreeFrame::ContainsFlexibleColumn(PRInt32 aStartIndex, PRInt32 aEndIndex, if (colContent) { nsAutoString fixedValue; colContent->GetAttribute(kNameSpaceID_None, fixedAtom, fixedValue); - if (fixedValue != "true") { + if (!fixedValue.Equals("true")) { // We are a proportional column. if (aResult) *aResult = result; diff --git a/mozilla/layout/xul/base/src/nsTreeRowFrame.cpp b/mozilla/layout/xul/base/src/nsTreeRowFrame.cpp index 671a10357ea..c826dd5bf70 100644 --- a/mozilla/layout/xul/base/src/nsTreeRowFrame.cpp +++ b/mozilla/layout/xul/base/src/nsTreeRowFrame.cpp @@ -309,7 +309,7 @@ nsTreeRowFrame::HandleHeaderDragEvent(nsIPresContext* aPresContext, if (colContent) { nsAutoString fixedValue; colContent->GetAttribute(kNameSpaceID_None, fixedAtom, fixedValue); - if (fixedValue != "true") { + if (!fixedValue.Equals("true")) { // We are a proportional column and should be annotated with our current // width. PRInt32 colWidth = treeFrame->GetColumnWidth(i); diff --git a/mozilla/layout/xul/base/src/nsTreeRowGroupFrame.cpp b/mozilla/layout/xul/base/src/nsTreeRowGroupFrame.cpp index c332ca94d34..03a31d987fa 100644 --- a/mozilla/layout/xul/base/src/nsTreeRowGroupFrame.cpp +++ b/mozilla/layout/xul/base/src/nsTreeRowGroupFrame.cpp @@ -539,7 +539,7 @@ nsTreeRowGroupFrame::FindRowContentAtIndex(PRInt32& aIndex, nsCOMPtr openAtom = dont_AddRef(NS_NewAtom("open")); nsAutoString isOpen; childContent->GetAttribute(kNameSpaceID_None, openAtom, isOpen); - if (isOpen == "true") { + if (isOpen.Equals("true")) { // Find the node. PRInt32 childContentCount; nsCOMPtr grandChild; @@ -615,7 +615,7 @@ nsTreeRowGroupFrame::FindPreviousRowContent(PRInt32& aDelta, nsIContent* aUpward nsCOMPtr openAtom = dont_AddRef(NS_NewAtom("open")); nsAutoString isOpen; childContent->GetAttribute(kNameSpaceID_None, openAtom, isOpen); - if (isOpen == "true") { + if (isOpen.Equals("true")) { // Find the node. PRInt32 childContentCount; nsCOMPtr grandChild; @@ -683,7 +683,7 @@ nsTreeRowGroupFrame::ComputeTotalRowCount(PRInt32& aCount, nsIContent* aParent) nsCOMPtr parent; childContent->GetParent(*getter_AddRefs(parent)); parent->GetAttribute(kNameSpaceID_None, openAtom, isOpen); - if (isOpen == "true") + if (isOpen.Equals("true")) ComputeTotalRowCount(aCount, childContent); } } @@ -1566,7 +1566,7 @@ nsTreeRowGroupFrame::ReflowScrollbar(nsIPresContext* aPresContext) nsXULAtoms::curpos, value); } - if (nukeScrollbar || (value == "0" && !mIsFull)) { + if (nukeScrollbar || (value.Equals("0") && !mIsFull)) { // clear the scrollbar out of the event state manager so that the // event manager doesn't send events to the destroyed scrollbar frames diff --git a/mozilla/layout/xul/base/src/nsTreeTwistyListener.cpp b/mozilla/layout/xul/base/src/nsTreeTwistyListener.cpp index d4f52cfc1cb..43be1c8abc0 100644 --- a/mozilla/layout/xul/base/src/nsTreeTwistyListener.cpp +++ b/mozilla/layout/xul/base/src/nsTreeTwistyListener.cpp @@ -88,11 +88,11 @@ nsTreeTwistyListener::MouseDown(nsIDOMEvent* aEvent) nsAutoString tagName; element->GetTagName(tagName); - if (tagName == "titledbutton") { + if (tagName.Equals("titledbutton")) { // Find out if we're the twisty. nsAutoString classAttr; element->GetAttribute("class", classAttr); - if (classAttr == "twisty") { + if (classAttr.Equals("twisty")) { // Retrieve the parent treeitem. nsCOMPtr treeItem; GetTreeItem(element, getter_AddRefs(treeItem)); @@ -107,7 +107,7 @@ nsTreeTwistyListener::MouseDown(nsIDOMEvent* aEvent) nsAutoString open; treeItem->GetAttribute("open", open); - if (open == "true") + if (open.Equals("true")) treeItem->RemoveAttribute("open"); else treeItem->SetAttribute("open", "true"); } diff --git a/mozilla/layout/xul/base/src/nsXULTextFrame.cpp b/mozilla/layout/xul/base/src/nsXULTextFrame.cpp index 5850cecf173..51ad54401f7 100644 --- a/mozilla/layout/xul/base/src/nsXULTextFrame.cpp +++ b/mozilla/layout/xul/base/src/nsXULTextFrame.cpp @@ -139,7 +139,7 @@ nsXULTextFrame::Init(nsIPresContext* aPresContext, nsAutoString accesskey; mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::accesskey, accesskey); - if (accesskey != "") { + if (!accesskey.IsEmpty()) { if (!mAccessKeyInfo) mAccessKeyInfo = new nsAccessKeyInfo(); @@ -540,7 +540,7 @@ nsXULTextFrame::UpdateAccessUnderline() nsAutoString accesskey; mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::accesskey, accesskey); - if (accesskey == "") { + if (accesskey.IsEmpty()) { if (mAccessKeyInfo) { delete mAccessKeyInfo; mAccessKeyInfo = nsnull;