diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index b1f608d1b6a..58516506158 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -3648,7 +3648,7 @@ nsDocument::SaveFile(nsFileSpec* aFileSpec, if (NS_FAILED(rv)) return rv; - nsAutoString charsetStr = aSaveCharset; + nsAutoString charsetStr(aSaveCharset); if (charsetStr.Length() == 0) { rv = GetDocumentCharacterSet(charsetStr); diff --git a/content/base/src/nsHTMLValue.h b/content/base/src/nsHTMLValue.h index 0592eb6c4c7..cfd8018c71a 100644 --- a/content/base/src/nsHTMLValue.h +++ b/content/base/src/nsHTMLValue.h @@ -104,7 +104,7 @@ inline PRInt32 nsHTMLValue::GetIntValue(void) const else if (mUnit == eHTMLUnit_String) { if (mValue.mString) { PRInt32 err=0; - nsAutoString str = mValue.mString; // XXX copy. new string APIs will make this better, right? + nsAutoString str(mValue.mString); // XXX copy. new string APIs will make this better, right? return str.ToInteger(&err); } } diff --git a/content/base/src/nsSelection.cpp b/content/base/src/nsSelection.cpp index 5dc9dc22c02..264f88a06d9 100644 --- a/content/base/src/nsSelection.cpp +++ b/content/base/src/nsSelection.cpp @@ -1533,7 +1533,7 @@ nsDOMSelection::ToString(const nsString& aFormatType, PRUint32 aFlags, PRInt32 a nsresult rv = NS_OK; nsCOMPtr encoder; - nsCAutoString formatType = NS_DOC_ENCODER_PROGID_BASE; + nsCAutoString formatType( NS_DOC_ENCODER_PROGID_BASE ); formatType.AppendWithConversion(aFormatType); rv = nsComponentManager::CreateInstance(formatType, nsnull, diff --git a/content/html/content/src/nsHTMLOptionElement.cpp b/content/html/content/src/nsHTMLOptionElement.cpp index 3fc22969445..59ad9b45008 100644 --- a/content/html/content/src/nsHTMLOptionElement.cpp +++ b/content/html/content/src/nsHTMLOptionElement.cpp @@ -485,7 +485,7 @@ nsHTMLOptionElement::GetText(nsString& aText) // the option could be all spaces, so compress the white space // then make sure the length is greater than zero if (aText.Length() > 0) { - nsAutoString compressText = aText; + nsAutoString compressText(aText); compressText.CompressWhitespace(PR_TRUE, PR_TRUE); if (compressText.Length() != 0) { aText = compressText; diff --git a/content/html/document/src/nsHTMLContentSink.cpp b/content/html/document/src/nsHTMLContentSink.cpp index 0c09f29333d..8c87eacb8b4 100644 --- a/content/html/document/src/nsHTMLContentSink.cpp +++ b/content/html/document/src/nsHTMLContentSink.cpp @@ -3732,7 +3732,7 @@ HTMLContentSink::ProcessLink(nsIHTMLContent* aElement, const nsString& aLinkData } if (kNullCh != *equals) { *equals = kNullCh; - nsAutoString attr = start; + nsAutoString attr(start); attr.StripWhitespace(); PRUnichar* value = ++equals; @@ -4238,7 +4238,7 @@ HTMLContentSink::ProcessMETATag(const nsIParserNode& aNode) if (!uriAttrib) { uri = baseURI; } else { - rv = NS_NewURI(getter_AddRefs(uri), uriAttrib, baseURI); + rv = NS_NewURI(getter_AddRefs(uri), nsAutoString(uriAttrib), baseURI); nsMemory::Free(uriAttrib); } diff --git a/content/html/style/src/nsCSSLoader.cpp b/content/html/style/src/nsCSSLoader.cpp index 6203926d545..2037df46b6a 100644 --- a/content/html/style/src/nsCSSLoader.cpp +++ b/content/html/style/src/nsCSSLoader.cpp @@ -1573,7 +1573,7 @@ NS_IMETHODIMP CSSLoaderImpl::SetCharset(/*in*/ const nsString &aCharsetSrc) } else { NS_WITH_SERVICE(nsICharsetAlias, calias, kCharsetAliasCID, &rv); NS_ASSERTION(calias, "cannot find charset alias"); - nsAutoString charsetName = aCharsetSrc; + nsAutoString charsetName(aCharsetSrc); if( NS_SUCCEEDED(rv) && (nsnull != calias)) { PRBool same = PR_FALSE; diff --git a/content/html/style/src/nsHTMLValue.h b/content/html/style/src/nsHTMLValue.h index 0592eb6c4c7..cfd8018c71a 100644 --- a/content/html/style/src/nsHTMLValue.h +++ b/content/html/style/src/nsHTMLValue.h @@ -104,7 +104,7 @@ inline PRInt32 nsHTMLValue::GetIntValue(void) const else if (mUnit == eHTMLUnit_String) { if (mValue.mString) { PRInt32 err=0; - nsAutoString str = mValue.mString; // XXX copy. new string APIs will make this better, right? + nsAutoString str(mValue.mString); // XXX copy. new string APIs will make this better, right? return str.ToInteger(&err); } } diff --git a/content/shared/public/nsHTMLValue.h b/content/shared/public/nsHTMLValue.h index 0592eb6c4c7..cfd8018c71a 100644 --- a/content/shared/public/nsHTMLValue.h +++ b/content/shared/public/nsHTMLValue.h @@ -104,7 +104,7 @@ inline PRInt32 nsHTMLValue::GetIntValue(void) const else if (mUnit == eHTMLUnit_String) { if (mValue.mString) { PRInt32 err=0; - nsAutoString str = mValue.mString; // XXX copy. new string APIs will make this better, right? + nsAutoString str(mValue.mString); // XXX copy. new string APIs will make this better, right? return str.ToInteger(&err); } } diff --git a/content/xbl/src/nsBindingManager.cpp b/content/xbl/src/nsBindingManager.cpp index 003c1f68314..bb57913398c 100644 --- a/content/xbl/src/nsBindingManager.cpp +++ b/content/xbl/src/nsBindingManager.cpp @@ -382,7 +382,7 @@ nsBindingManager::LoadBindingDocument(const nsString& aURL) // Load the binding doc. nsCString url; url.AssignWithConversion(aURL); nsCOMPtr info; - xblService->LoadBindingDocumentInfo(nsnull, url, "", PR_TRUE, getter_AddRefs(info)); + xblService->LoadBindingDocumentInfo(nsnull, url, nsCAutoString(), PR_TRUE, getter_AddRefs(info)); if (!info) return NS_ERROR_FAILURE; diff --git a/content/xbl/src/nsXBLBinding.cpp b/content/xbl/src/nsXBLBinding.cpp index f2612b68cd9..fd97dc32824 100644 --- a/content/xbl/src/nsXBLBinding.cpp +++ b/content/xbl/src/nsXBLBinding.cpp @@ -867,7 +867,7 @@ nsXBLBinding::InstallProperties(nsIContent* aBoundElement) if (!getter.IsEmpty() && classObject) { rv = context->CompileFunction(classObject, - "onget", + nsCAutoString("onget"), 0, nsnull, getter, @@ -901,7 +901,7 @@ nsXBLBinding::InstallProperties(nsIContent* aBoundElement) if (!setter.IsEmpty() && classObject) { rv = context->CompileFunction(classObject, - "onset", + nsCAutoString("onset"), 1, gPropertyArg, setter, diff --git a/content/xbl/src/nsXBLService.cpp b/content/xbl/src/nsXBLService.cpp index 2090bea489c..061cc7515a8 100644 --- a/content/xbl/src/nsXBLService.cpp +++ b/content/xbl/src/nsXBLService.cpp @@ -320,7 +320,7 @@ nsXBLStreamListener::Load(nsIDOMEvent* aEvent) nsCOMPtr uri(mBindingDocument->GetDocumentURL()); nsXPIDLCString str; uri->GetSpec(getter_Copies(str)); - bindingManager->RemoveLoadingDocListener((const char*)str); + bindingManager->RemoveLoadingDocListener(nsCAutoString(NS_STATIC_CAST(const char*, str))); nsCOMPtr root = getter_AddRefs(mBindingDocument->GetRootContent()); if (root) @@ -592,7 +592,7 @@ nsXBLService::LoadBindings(nsIContent* aContent, const nsString& aURL, PRBool aA } if (!newBinding) { - nsCAutoString str = "Failed to locate XBL binding. XBL is now using id instead of name to reference bindings. Make sure you have switched over. The invalid binding name is: "; + nsCAutoString str( "Failed to locate XBL binding. XBL is now using id instead of name to reference bindings. Make sure you have switched over. The invalid binding name is: "); str.AppendWithConversion(aURL); NS_ERROR(str); return NS_OK; @@ -1057,7 +1057,7 @@ nsXBLService::FetchBindingDocument(nsIContent* aBoundElement, nsIURI* aURI, cons boundDocument->GetBindingManager(getter_AddRefs(bindingManager)); nsXPIDLCString uri; aURI->GetSpec(getter_Copies(uri)); - bindingManager->PutLoadingDocListener((const char*)uri, xblListener); + bindingManager->PutLoadingDocListener(nsCAutoString(NS_STATIC_CAST(const char*, uri)), xblListener); // Add our request. nsCAutoString bindingURI(uri); diff --git a/content/xml/document/src/nsXMLContentSink.cpp b/content/xml/document/src/nsXMLContentSink.cpp index 75b50f518a3..e95628978de 100644 --- a/content/xml/document/src/nsXMLContentSink.cpp +++ b/content/xml/document/src/nsXMLContentSink.cpp @@ -2006,7 +2006,7 @@ nsXMLContentSink::GetElementFactory(PRInt32 aNameSpaceID, nsIElementFactory** aR nsAutoString nameSpace; gNameSpaceManager->GetNameSpaceURI(aNameSpaceID, nameSpace); - nsCAutoString progID = NS_ELEMENT_FACTORY_PROGID_PREFIX; + nsCAutoString progID( NS_ELEMENT_FACTORY_PROGID_PREFIX ); progID.AppendWithConversion(nameSpace); // Retrieve the appropriate factory. diff --git a/layout/base/src/nsDocument.cpp b/layout/base/src/nsDocument.cpp index b1f608d1b6a..58516506158 100644 --- a/layout/base/src/nsDocument.cpp +++ b/layout/base/src/nsDocument.cpp @@ -3648,7 +3648,7 @@ nsDocument::SaveFile(nsFileSpec* aFileSpec, if (NS_FAILED(rv)) return rv; - nsAutoString charsetStr = aSaveCharset; + nsAutoString charsetStr(aSaveCharset); if (charsetStr.Length() == 0) { rv = GetDocumentCharacterSet(charsetStr); diff --git a/layout/base/src/nsSelection.cpp b/layout/base/src/nsSelection.cpp index 5dc9dc22c02..264f88a06d9 100644 --- a/layout/base/src/nsSelection.cpp +++ b/layout/base/src/nsSelection.cpp @@ -1533,7 +1533,7 @@ nsDOMSelection::ToString(const nsString& aFormatType, PRUint32 aFlags, PRInt32 a nsresult rv = NS_OK; nsCOMPtr encoder; - nsCAutoString formatType = NS_DOC_ENCODER_PROGID_BASE; + nsCAutoString formatType( NS_DOC_ENCODER_PROGID_BASE ); formatType.AppendWithConversion(aFormatType); rv = nsComponentManager::CreateInstance(formatType, nsnull, diff --git a/layout/generic/nsFrameFrame.cpp b/layout/generic/nsFrameFrame.cpp index 16053ff7c5a..f5d44208777 100644 --- a/layout/generic/nsFrameFrame.cpp +++ b/layout/generic/nsFrameFrame.cpp @@ -857,7 +857,7 @@ nsHTMLFrameInnerFrame::DoLoadURL(nsIPresContext* aPresContext) NS_ENSURE_SUCCESS(rv, rv); nsCOMPtr uri; - NS_NewURI(getter_AddRefs(uri), absURL.GetUnicode(), nsnull); + NS_NewURI(getter_AddRefs(uri), absURL, nsnull); // Check for security NS_WITH_SERVICE(nsIScriptSecurityManager, secMan, diff --git a/layout/generic/nsObjectFrame.cpp b/layout/generic/nsObjectFrame.cpp index 7f69073e44e..d8002cf4747 100644 --- a/layout/generic/nsObjectFrame.cpp +++ b/layout/generic/nsObjectFrame.cpp @@ -1051,10 +1051,11 @@ nsObjectFrame::IsHidden() const // Yes, these are really the kooky ways that you could tell 4.x // not to hide the once you'd put the 'hidden' attribute // on the tag... + // these |NS_ConvertASCIItoUCS2|s can't be |NS_LITERAL_STRING|s until |EqualsIgnoreCase| get's fixed if (hidden.Length() && - ! hidden.EqualsIgnoreCase(NS_LITERAL_STRING("false")) && - ! hidden.EqualsIgnoreCase(NS_LITERAL_STRING("no")) && - ! hidden.EqualsIgnoreCase(NS_LITERAL_STRING("off"))) { + ! hidden.EqualsIgnoreCase(NS_ConvertASCIItoUCS2("false")) && + ! hidden.EqualsIgnoreCase(NS_ConvertASCIItoUCS2("no")) && + ! hidden.EqualsIgnoreCase(NS_ConvertASCIItoUCS2("off"))) { // The or is hidden. return PR_TRUE; } diff --git a/layout/generic/nsSelection.cpp b/layout/generic/nsSelection.cpp index 5dc9dc22c02..264f88a06d9 100644 --- a/layout/generic/nsSelection.cpp +++ b/layout/generic/nsSelection.cpp @@ -1533,7 +1533,7 @@ nsDOMSelection::ToString(const nsString& aFormatType, PRUint32 aFlags, PRInt32 a nsresult rv = NS_OK; nsCOMPtr encoder; - nsCAutoString formatType = NS_DOC_ENCODER_PROGID_BASE; + nsCAutoString formatType( NS_DOC_ENCODER_PROGID_BASE ); formatType.AppendWithConversion(aFormatType); rv = nsComponentManager::CreateInstance(formatType, nsnull, diff --git a/layout/html/base/src/nsObjectFrame.cpp b/layout/html/base/src/nsObjectFrame.cpp index 7f69073e44e..d8002cf4747 100644 --- a/layout/html/base/src/nsObjectFrame.cpp +++ b/layout/html/base/src/nsObjectFrame.cpp @@ -1051,10 +1051,11 @@ nsObjectFrame::IsHidden() const // Yes, these are really the kooky ways that you could tell 4.x // not to hide the once you'd put the 'hidden' attribute // on the tag... + // these |NS_ConvertASCIItoUCS2|s can't be |NS_LITERAL_STRING|s until |EqualsIgnoreCase| get's fixed if (hidden.Length() && - ! hidden.EqualsIgnoreCase(NS_LITERAL_STRING("false")) && - ! hidden.EqualsIgnoreCase(NS_LITERAL_STRING("no")) && - ! hidden.EqualsIgnoreCase(NS_LITERAL_STRING("off"))) { + ! hidden.EqualsIgnoreCase(NS_ConvertASCIItoUCS2("false")) && + ! hidden.EqualsIgnoreCase(NS_ConvertASCIItoUCS2("no")) && + ! hidden.EqualsIgnoreCase(NS_ConvertASCIItoUCS2("off"))) { // The or is hidden. return PR_TRUE; } diff --git a/layout/html/content/src/nsHTMLOptionElement.cpp b/layout/html/content/src/nsHTMLOptionElement.cpp index 3fc22969445..59ad9b45008 100644 --- a/layout/html/content/src/nsHTMLOptionElement.cpp +++ b/layout/html/content/src/nsHTMLOptionElement.cpp @@ -485,7 +485,7 @@ nsHTMLOptionElement::GetText(nsString& aText) // the option could be all spaces, so compress the white space // then make sure the length is greater than zero if (aText.Length() > 0) { - nsAutoString compressText = aText; + nsAutoString compressText(aText); compressText.CompressWhitespace(PR_TRUE, PR_TRUE); if (compressText.Length() != 0) { aText = compressText; diff --git a/layout/html/document/src/nsFrameFrame.cpp b/layout/html/document/src/nsFrameFrame.cpp index 16053ff7c5a..f5d44208777 100644 --- a/layout/html/document/src/nsFrameFrame.cpp +++ b/layout/html/document/src/nsFrameFrame.cpp @@ -857,7 +857,7 @@ nsHTMLFrameInnerFrame::DoLoadURL(nsIPresContext* aPresContext) NS_ENSURE_SUCCESS(rv, rv); nsCOMPtr uri; - NS_NewURI(getter_AddRefs(uri), absURL.GetUnicode(), nsnull); + NS_NewURI(getter_AddRefs(uri), absURL, nsnull); // Check for security NS_WITH_SERVICE(nsIScriptSecurityManager, secMan, diff --git a/layout/html/document/src/nsHTMLContentSink.cpp b/layout/html/document/src/nsHTMLContentSink.cpp index 0c09f29333d..8c87eacb8b4 100644 --- a/layout/html/document/src/nsHTMLContentSink.cpp +++ b/layout/html/document/src/nsHTMLContentSink.cpp @@ -3732,7 +3732,7 @@ HTMLContentSink::ProcessLink(nsIHTMLContent* aElement, const nsString& aLinkData } if (kNullCh != *equals) { *equals = kNullCh; - nsAutoString attr = start; + nsAutoString attr(start); attr.StripWhitespace(); PRUnichar* value = ++equals; @@ -4238,7 +4238,7 @@ HTMLContentSink::ProcessMETATag(const nsIParserNode& aNode) if (!uriAttrib) { uri = baseURI; } else { - rv = NS_NewURI(getter_AddRefs(uri), uriAttrib, baseURI); + rv = NS_NewURI(getter_AddRefs(uri), nsAutoString(uriAttrib), baseURI); nsMemory::Free(uriAttrib); } diff --git a/layout/html/style/src/nsCSSLoader.cpp b/layout/html/style/src/nsCSSLoader.cpp index 6203926d545..2037df46b6a 100644 --- a/layout/html/style/src/nsCSSLoader.cpp +++ b/layout/html/style/src/nsCSSLoader.cpp @@ -1573,7 +1573,7 @@ NS_IMETHODIMP CSSLoaderImpl::SetCharset(/*in*/ const nsString &aCharsetSrc) } else { NS_WITH_SERVICE(nsICharsetAlias, calias, kCharsetAliasCID, &rv); NS_ASSERTION(calias, "cannot find charset alias"); - nsAutoString charsetName = aCharsetSrc; + nsAutoString charsetName(aCharsetSrc); if( NS_SUCCEEDED(rv) && (nsnull != calias)) { PRBool same = PR_FALSE; diff --git a/layout/html/style/src/nsHTMLValue.h b/layout/html/style/src/nsHTMLValue.h index 0592eb6c4c7..cfd8018c71a 100644 --- a/layout/html/style/src/nsHTMLValue.h +++ b/layout/html/style/src/nsHTMLValue.h @@ -104,7 +104,7 @@ inline PRInt32 nsHTMLValue::GetIntValue(void) const else if (mUnit == eHTMLUnit_String) { if (mValue.mString) { PRInt32 err=0; - nsAutoString str = mValue.mString; // XXX copy. new string APIs will make this better, right? + nsAutoString str(mValue.mString); // XXX copy. new string APIs will make this better, right? return str.ToInteger(&err); } } diff --git a/layout/style/nsCSSLoader.cpp b/layout/style/nsCSSLoader.cpp index 6203926d545..2037df46b6a 100644 --- a/layout/style/nsCSSLoader.cpp +++ b/layout/style/nsCSSLoader.cpp @@ -1573,7 +1573,7 @@ NS_IMETHODIMP CSSLoaderImpl::SetCharset(/*in*/ const nsString &aCharsetSrc) } else { NS_WITH_SERVICE(nsICharsetAlias, calias, kCharsetAliasCID, &rv); NS_ASSERTION(calias, "cannot find charset alias"); - nsAutoString charsetName = aCharsetSrc; + nsAutoString charsetName(aCharsetSrc); if( NS_SUCCEEDED(rv) && (nsnull != calias)) { PRBool same = PR_FALSE; diff --git a/layout/xbl/src/nsBindingManager.cpp b/layout/xbl/src/nsBindingManager.cpp index 003c1f68314..bb57913398c 100644 --- a/layout/xbl/src/nsBindingManager.cpp +++ b/layout/xbl/src/nsBindingManager.cpp @@ -382,7 +382,7 @@ nsBindingManager::LoadBindingDocument(const nsString& aURL) // Load the binding doc. nsCString url; url.AssignWithConversion(aURL); nsCOMPtr info; - xblService->LoadBindingDocumentInfo(nsnull, url, "", PR_TRUE, getter_AddRefs(info)); + xblService->LoadBindingDocumentInfo(nsnull, url, nsCAutoString(), PR_TRUE, getter_AddRefs(info)); if (!info) return NS_ERROR_FAILURE; diff --git a/layout/xbl/src/nsXBLBinding.cpp b/layout/xbl/src/nsXBLBinding.cpp index f2612b68cd9..fd97dc32824 100644 --- a/layout/xbl/src/nsXBLBinding.cpp +++ b/layout/xbl/src/nsXBLBinding.cpp @@ -867,7 +867,7 @@ nsXBLBinding::InstallProperties(nsIContent* aBoundElement) if (!getter.IsEmpty() && classObject) { rv = context->CompileFunction(classObject, - "onget", + nsCAutoString("onget"), 0, nsnull, getter, @@ -901,7 +901,7 @@ nsXBLBinding::InstallProperties(nsIContent* aBoundElement) if (!setter.IsEmpty() && classObject) { rv = context->CompileFunction(classObject, - "onset", + nsCAutoString("onset"), 1, gPropertyArg, setter, diff --git a/layout/xbl/src/nsXBLService.cpp b/layout/xbl/src/nsXBLService.cpp index 2090bea489c..061cc7515a8 100644 --- a/layout/xbl/src/nsXBLService.cpp +++ b/layout/xbl/src/nsXBLService.cpp @@ -320,7 +320,7 @@ nsXBLStreamListener::Load(nsIDOMEvent* aEvent) nsCOMPtr uri(mBindingDocument->GetDocumentURL()); nsXPIDLCString str; uri->GetSpec(getter_Copies(str)); - bindingManager->RemoveLoadingDocListener((const char*)str); + bindingManager->RemoveLoadingDocListener(nsCAutoString(NS_STATIC_CAST(const char*, str))); nsCOMPtr root = getter_AddRefs(mBindingDocument->GetRootContent()); if (root) @@ -592,7 +592,7 @@ nsXBLService::LoadBindings(nsIContent* aContent, const nsString& aURL, PRBool aA } if (!newBinding) { - nsCAutoString str = "Failed to locate XBL binding. XBL is now using id instead of name to reference bindings. Make sure you have switched over. The invalid binding name is: "; + nsCAutoString str( "Failed to locate XBL binding. XBL is now using id instead of name to reference bindings. Make sure you have switched over. The invalid binding name is: "); str.AppendWithConversion(aURL); NS_ERROR(str); return NS_OK; @@ -1057,7 +1057,7 @@ nsXBLService::FetchBindingDocument(nsIContent* aBoundElement, nsIURI* aURI, cons boundDocument->GetBindingManager(getter_AddRefs(bindingManager)); nsXPIDLCString uri; aURI->GetSpec(getter_Copies(uri)); - bindingManager->PutLoadingDocListener((const char*)uri, xblListener); + bindingManager->PutLoadingDocListener(nsCAutoString(NS_STATIC_CAST(const char*, uri)), xblListener); // Add our request. nsCAutoString bindingURI(uri); diff --git a/layout/xml/document/src/nsXMLContentSink.cpp b/layout/xml/document/src/nsXMLContentSink.cpp index 75b50f518a3..e95628978de 100644 --- a/layout/xml/document/src/nsXMLContentSink.cpp +++ b/layout/xml/document/src/nsXMLContentSink.cpp @@ -2006,7 +2006,7 @@ nsXMLContentSink::GetElementFactory(PRInt32 aNameSpaceID, nsIElementFactory** aR nsAutoString nameSpace; gNameSpaceManager->GetNameSpaceURI(aNameSpaceID, nameSpace); - nsCAutoString progID = NS_ELEMENT_FACTORY_PROGID_PREFIX; + nsCAutoString progID( NS_ELEMENT_FACTORY_PROGID_PREFIX ); progID.AppendWithConversion(nameSpace); // Retrieve the appropriate factory. diff --git a/layout/xul/base/src/nsPopupSetBoxObject.cpp b/layout/xul/base/src/nsPopupSetBoxObject.cpp index 2d1cf324cb4..0545148b2d1 100644 --- a/layout/xul/base/src/nsPopupSetBoxObject.cpp +++ b/layout/xul/base/src/nsPopupSetBoxObject.cpp @@ -136,7 +136,7 @@ nsPopupSetBoxObject::CreatePopup(nsIDOMElement* aSrcContent, if (!shell) return NS_OK; - return popupFrame->CreatePopup(srcContent, popupContent, aXPos, aYPos, aPopupType, anAnchorAlignment, aPopupAlignment); + return popupFrame->CreatePopup(srcContent, popupContent, aXPos, aYPos, nsAutoString(aPopupType), nsAutoString(anAnchorAlignment), nsAutoString(aPopupAlignment)); } NS_IMETHODIMP nsPopupSetBoxObject::GetActiveChild(nsIDOMElement** aResult) diff --git a/layout/xul/base/src/nsTextBoxFrame.cpp b/layout/xul/base/src/nsTextBoxFrame.cpp index 45577c3c389..3fad72b8336 100644 --- a/layout/xul/base/src/nsTextBoxFrame.cpp +++ b/layout/xul/base/src/nsTextBoxFrame.cpp @@ -441,7 +441,7 @@ nsTextBoxFrame::CalculateTitleForWidth(nsIPresContext* aPresContext, nsIRenderin return; // insert what character we can in. - nsAutoString title = mTitle; + nsAutoString title( mTitle ); title.Truncate(i); mCroppedTitle.Insert(title, 0); }