зеркало из https://github.com/mozilla/pjs.git
fixing code that relied on implicit string construction
This commit is contained in:
Родитель
61d9f3abd8
Коммит
301746a559
|
@ -3648,7 +3648,7 @@ nsDocument::SaveFile(nsFileSpec* aFileSpec,
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
return rv;
|
return rv;
|
||||||
|
|
||||||
nsAutoString charsetStr = aSaveCharset;
|
nsAutoString charsetStr(aSaveCharset);
|
||||||
if (charsetStr.Length() == 0)
|
if (charsetStr.Length() == 0)
|
||||||
{
|
{
|
||||||
rv = GetDocumentCharacterSet(charsetStr);
|
rv = GetDocumentCharacterSet(charsetStr);
|
||||||
|
|
|
@ -104,7 +104,7 @@ inline PRInt32 nsHTMLValue::GetIntValue(void) const
|
||||||
else if (mUnit == eHTMLUnit_String) {
|
else if (mUnit == eHTMLUnit_String) {
|
||||||
if (mValue.mString) {
|
if (mValue.mString) {
|
||||||
PRInt32 err=0;
|
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);
|
return str.ToInteger(&err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1533,7 +1533,7 @@ nsDOMSelection::ToString(const nsString& aFormatType, PRUint32 aFlags, PRInt32 a
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
nsCOMPtr<nsIDocumentEncoder> encoder;
|
nsCOMPtr<nsIDocumentEncoder> encoder;
|
||||||
nsCAutoString formatType = NS_DOC_ENCODER_PROGID_BASE;
|
nsCAutoString formatType( NS_DOC_ENCODER_PROGID_BASE );
|
||||||
formatType.AppendWithConversion(aFormatType);
|
formatType.AppendWithConversion(aFormatType);
|
||||||
rv = nsComponentManager::CreateInstance(formatType,
|
rv = nsComponentManager::CreateInstance(formatType,
|
||||||
nsnull,
|
nsnull,
|
||||||
|
|
|
@ -485,7 +485,7 @@ nsHTMLOptionElement::GetText(nsString& aText)
|
||||||
// the option could be all spaces, so compress the white space
|
// the option could be all spaces, so compress the white space
|
||||||
// then make sure the length is greater than zero
|
// then make sure the length is greater than zero
|
||||||
if (aText.Length() > 0) {
|
if (aText.Length() > 0) {
|
||||||
nsAutoString compressText = aText;
|
nsAutoString compressText(aText);
|
||||||
compressText.CompressWhitespace(PR_TRUE, PR_TRUE);
|
compressText.CompressWhitespace(PR_TRUE, PR_TRUE);
|
||||||
if (compressText.Length() != 0) {
|
if (compressText.Length() != 0) {
|
||||||
aText = compressText;
|
aText = compressText;
|
||||||
|
|
|
@ -3732,7 +3732,7 @@ HTMLContentSink::ProcessLink(nsIHTMLContent* aElement, const nsString& aLinkData
|
||||||
}
|
}
|
||||||
if (kNullCh != *equals) {
|
if (kNullCh != *equals) {
|
||||||
*equals = kNullCh;
|
*equals = kNullCh;
|
||||||
nsAutoString attr = start;
|
nsAutoString attr(start);
|
||||||
attr.StripWhitespace();
|
attr.StripWhitespace();
|
||||||
|
|
||||||
PRUnichar* value = ++equals;
|
PRUnichar* value = ++equals;
|
||||||
|
@ -4238,7 +4238,7 @@ HTMLContentSink::ProcessMETATag(const nsIParserNode& aNode)
|
||||||
if (!uriAttrib) {
|
if (!uriAttrib) {
|
||||||
uri = baseURI;
|
uri = baseURI;
|
||||||
} else {
|
} else {
|
||||||
rv = NS_NewURI(getter_AddRefs(uri), uriAttrib, baseURI);
|
rv = NS_NewURI(getter_AddRefs(uri), nsAutoString(uriAttrib), baseURI);
|
||||||
nsMemory::Free(uriAttrib);
|
nsMemory::Free(uriAttrib);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1573,7 +1573,7 @@ NS_IMETHODIMP CSSLoaderImpl::SetCharset(/*in*/ const nsString &aCharsetSrc)
|
||||||
} else {
|
} else {
|
||||||
NS_WITH_SERVICE(nsICharsetAlias, calias, kCharsetAliasCID, &rv);
|
NS_WITH_SERVICE(nsICharsetAlias, calias, kCharsetAliasCID, &rv);
|
||||||
NS_ASSERTION(calias, "cannot find charset alias");
|
NS_ASSERTION(calias, "cannot find charset alias");
|
||||||
nsAutoString charsetName = aCharsetSrc;
|
nsAutoString charsetName(aCharsetSrc);
|
||||||
if( NS_SUCCEEDED(rv) && (nsnull != calias))
|
if( NS_SUCCEEDED(rv) && (nsnull != calias))
|
||||||
{
|
{
|
||||||
PRBool same = PR_FALSE;
|
PRBool same = PR_FALSE;
|
||||||
|
|
|
@ -104,7 +104,7 @@ inline PRInt32 nsHTMLValue::GetIntValue(void) const
|
||||||
else if (mUnit == eHTMLUnit_String) {
|
else if (mUnit == eHTMLUnit_String) {
|
||||||
if (mValue.mString) {
|
if (mValue.mString) {
|
||||||
PRInt32 err=0;
|
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);
|
return str.ToInteger(&err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,7 +104,7 @@ inline PRInt32 nsHTMLValue::GetIntValue(void) const
|
||||||
else if (mUnit == eHTMLUnit_String) {
|
else if (mUnit == eHTMLUnit_String) {
|
||||||
if (mValue.mString) {
|
if (mValue.mString) {
|
||||||
PRInt32 err=0;
|
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);
|
return str.ToInteger(&err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -382,7 +382,7 @@ nsBindingManager::LoadBindingDocument(const nsString& aURL)
|
||||||
// Load the binding doc.
|
// Load the binding doc.
|
||||||
nsCString url; url.AssignWithConversion(aURL);
|
nsCString url; url.AssignWithConversion(aURL);
|
||||||
nsCOMPtr<nsIXBLDocumentInfo> info;
|
nsCOMPtr<nsIXBLDocumentInfo> info;
|
||||||
xblService->LoadBindingDocumentInfo(nsnull, url, "", PR_TRUE, getter_AddRefs(info));
|
xblService->LoadBindingDocumentInfo(nsnull, url, nsCAutoString(), PR_TRUE, getter_AddRefs(info));
|
||||||
if (!info)
|
if (!info)
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
|
|
|
@ -867,7 +867,7 @@ nsXBLBinding::InstallProperties(nsIContent* aBoundElement)
|
||||||
|
|
||||||
if (!getter.IsEmpty() && classObject) {
|
if (!getter.IsEmpty() && classObject) {
|
||||||
rv = context->CompileFunction(classObject,
|
rv = context->CompileFunction(classObject,
|
||||||
"onget",
|
nsCAutoString("onget"),
|
||||||
0,
|
0,
|
||||||
nsnull,
|
nsnull,
|
||||||
getter,
|
getter,
|
||||||
|
@ -901,7 +901,7 @@ nsXBLBinding::InstallProperties(nsIContent* aBoundElement)
|
||||||
|
|
||||||
if (!setter.IsEmpty() && classObject) {
|
if (!setter.IsEmpty() && classObject) {
|
||||||
rv = context->CompileFunction(classObject,
|
rv = context->CompileFunction(classObject,
|
||||||
"onset",
|
nsCAutoString("onset"),
|
||||||
1,
|
1,
|
||||||
gPropertyArg,
|
gPropertyArg,
|
||||||
setter,
|
setter,
|
||||||
|
|
|
@ -320,7 +320,7 @@ nsXBLStreamListener::Load(nsIDOMEvent* aEvent)
|
||||||
nsCOMPtr<nsIURI> uri(mBindingDocument->GetDocumentURL());
|
nsCOMPtr<nsIURI> uri(mBindingDocument->GetDocumentURL());
|
||||||
nsXPIDLCString str;
|
nsXPIDLCString str;
|
||||||
uri->GetSpec(getter_Copies(str));
|
uri->GetSpec(getter_Copies(str));
|
||||||
bindingManager->RemoveLoadingDocListener((const char*)str);
|
bindingManager->RemoveLoadingDocListener(nsCAutoString(NS_STATIC_CAST(const char*, str)));
|
||||||
|
|
||||||
nsCOMPtr<nsIContent> root = getter_AddRefs(mBindingDocument->GetRootContent());
|
nsCOMPtr<nsIContent> root = getter_AddRefs(mBindingDocument->GetRootContent());
|
||||||
if (root)
|
if (root)
|
||||||
|
@ -592,7 +592,7 @@ nsXBLService::LoadBindings(nsIContent* aContent, const nsString& aURL, PRBool aA
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!newBinding) {
|
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);
|
str.AppendWithConversion(aURL);
|
||||||
NS_ERROR(str);
|
NS_ERROR(str);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
@ -1057,7 +1057,7 @@ nsXBLService::FetchBindingDocument(nsIContent* aBoundElement, nsIURI* aURI, cons
|
||||||
boundDocument->GetBindingManager(getter_AddRefs(bindingManager));
|
boundDocument->GetBindingManager(getter_AddRefs(bindingManager));
|
||||||
nsXPIDLCString uri;
|
nsXPIDLCString uri;
|
||||||
aURI->GetSpec(getter_Copies(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.
|
// Add our request.
|
||||||
nsCAutoString bindingURI(uri);
|
nsCAutoString bindingURI(uri);
|
||||||
|
|
|
@ -2006,7 +2006,7 @@ nsXMLContentSink::GetElementFactory(PRInt32 aNameSpaceID, nsIElementFactory** aR
|
||||||
nsAutoString nameSpace;
|
nsAutoString nameSpace;
|
||||||
gNameSpaceManager->GetNameSpaceURI(aNameSpaceID, nameSpace);
|
gNameSpaceManager->GetNameSpaceURI(aNameSpaceID, nameSpace);
|
||||||
|
|
||||||
nsCAutoString progID = NS_ELEMENT_FACTORY_PROGID_PREFIX;
|
nsCAutoString progID( NS_ELEMENT_FACTORY_PROGID_PREFIX );
|
||||||
progID.AppendWithConversion(nameSpace);
|
progID.AppendWithConversion(nameSpace);
|
||||||
|
|
||||||
// Retrieve the appropriate factory.
|
// Retrieve the appropriate factory.
|
||||||
|
|
|
@ -3648,7 +3648,7 @@ nsDocument::SaveFile(nsFileSpec* aFileSpec,
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
return rv;
|
return rv;
|
||||||
|
|
||||||
nsAutoString charsetStr = aSaveCharset;
|
nsAutoString charsetStr(aSaveCharset);
|
||||||
if (charsetStr.Length() == 0)
|
if (charsetStr.Length() == 0)
|
||||||
{
|
{
|
||||||
rv = GetDocumentCharacterSet(charsetStr);
|
rv = GetDocumentCharacterSet(charsetStr);
|
||||||
|
|
|
@ -1533,7 +1533,7 @@ nsDOMSelection::ToString(const nsString& aFormatType, PRUint32 aFlags, PRInt32 a
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
nsCOMPtr<nsIDocumentEncoder> encoder;
|
nsCOMPtr<nsIDocumentEncoder> encoder;
|
||||||
nsCAutoString formatType = NS_DOC_ENCODER_PROGID_BASE;
|
nsCAutoString formatType( NS_DOC_ENCODER_PROGID_BASE );
|
||||||
formatType.AppendWithConversion(aFormatType);
|
formatType.AppendWithConversion(aFormatType);
|
||||||
rv = nsComponentManager::CreateInstance(formatType,
|
rv = nsComponentManager::CreateInstance(formatType,
|
||||||
nsnull,
|
nsnull,
|
||||||
|
|
|
@ -857,7 +857,7 @@ nsHTMLFrameInnerFrame::DoLoadURL(nsIPresContext* aPresContext)
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsCOMPtr<nsIURI> uri;
|
nsCOMPtr<nsIURI> uri;
|
||||||
NS_NewURI(getter_AddRefs(uri), absURL.GetUnicode(), nsnull);
|
NS_NewURI(getter_AddRefs(uri), absURL, nsnull);
|
||||||
|
|
||||||
// Check for security
|
// Check for security
|
||||||
NS_WITH_SERVICE(nsIScriptSecurityManager, secMan,
|
NS_WITH_SERVICE(nsIScriptSecurityManager, secMan,
|
||||||
|
|
|
@ -1051,10 +1051,11 @@ nsObjectFrame::IsHidden() const
|
||||||
// Yes, these are really the kooky ways that you could tell 4.x
|
// Yes, these are really the kooky ways that you could tell 4.x
|
||||||
// not to hide the <embed> once you'd put the 'hidden' attribute
|
// not to hide the <embed> once you'd put the 'hidden' attribute
|
||||||
// on the tag...
|
// on the tag...
|
||||||
|
// these |NS_ConvertASCIItoUCS2|s can't be |NS_LITERAL_STRING|s until |EqualsIgnoreCase| get's fixed
|
||||||
if (hidden.Length() &&
|
if (hidden.Length() &&
|
||||||
! hidden.EqualsIgnoreCase(NS_LITERAL_STRING("false")) &&
|
! hidden.EqualsIgnoreCase(NS_ConvertASCIItoUCS2("false")) &&
|
||||||
! hidden.EqualsIgnoreCase(NS_LITERAL_STRING("no")) &&
|
! hidden.EqualsIgnoreCase(NS_ConvertASCIItoUCS2("no")) &&
|
||||||
! hidden.EqualsIgnoreCase(NS_LITERAL_STRING("off"))) {
|
! hidden.EqualsIgnoreCase(NS_ConvertASCIItoUCS2("off"))) {
|
||||||
// The <embed> or <applet> is hidden.
|
// The <embed> or <applet> is hidden.
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1533,7 +1533,7 @@ nsDOMSelection::ToString(const nsString& aFormatType, PRUint32 aFlags, PRInt32 a
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
nsCOMPtr<nsIDocumentEncoder> encoder;
|
nsCOMPtr<nsIDocumentEncoder> encoder;
|
||||||
nsCAutoString formatType = NS_DOC_ENCODER_PROGID_BASE;
|
nsCAutoString formatType( NS_DOC_ENCODER_PROGID_BASE );
|
||||||
formatType.AppendWithConversion(aFormatType);
|
formatType.AppendWithConversion(aFormatType);
|
||||||
rv = nsComponentManager::CreateInstance(formatType,
|
rv = nsComponentManager::CreateInstance(formatType,
|
||||||
nsnull,
|
nsnull,
|
||||||
|
|
|
@ -1051,10 +1051,11 @@ nsObjectFrame::IsHidden() const
|
||||||
// Yes, these are really the kooky ways that you could tell 4.x
|
// Yes, these are really the kooky ways that you could tell 4.x
|
||||||
// not to hide the <embed> once you'd put the 'hidden' attribute
|
// not to hide the <embed> once you'd put the 'hidden' attribute
|
||||||
// on the tag...
|
// on the tag...
|
||||||
|
// these |NS_ConvertASCIItoUCS2|s can't be |NS_LITERAL_STRING|s until |EqualsIgnoreCase| get's fixed
|
||||||
if (hidden.Length() &&
|
if (hidden.Length() &&
|
||||||
! hidden.EqualsIgnoreCase(NS_LITERAL_STRING("false")) &&
|
! hidden.EqualsIgnoreCase(NS_ConvertASCIItoUCS2("false")) &&
|
||||||
! hidden.EqualsIgnoreCase(NS_LITERAL_STRING("no")) &&
|
! hidden.EqualsIgnoreCase(NS_ConvertASCIItoUCS2("no")) &&
|
||||||
! hidden.EqualsIgnoreCase(NS_LITERAL_STRING("off"))) {
|
! hidden.EqualsIgnoreCase(NS_ConvertASCIItoUCS2("off"))) {
|
||||||
// The <embed> or <applet> is hidden.
|
// The <embed> or <applet> is hidden.
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -485,7 +485,7 @@ nsHTMLOptionElement::GetText(nsString& aText)
|
||||||
// the option could be all spaces, so compress the white space
|
// the option could be all spaces, so compress the white space
|
||||||
// then make sure the length is greater than zero
|
// then make sure the length is greater than zero
|
||||||
if (aText.Length() > 0) {
|
if (aText.Length() > 0) {
|
||||||
nsAutoString compressText = aText;
|
nsAutoString compressText(aText);
|
||||||
compressText.CompressWhitespace(PR_TRUE, PR_TRUE);
|
compressText.CompressWhitespace(PR_TRUE, PR_TRUE);
|
||||||
if (compressText.Length() != 0) {
|
if (compressText.Length() != 0) {
|
||||||
aText = compressText;
|
aText = compressText;
|
||||||
|
|
|
@ -857,7 +857,7 @@ nsHTMLFrameInnerFrame::DoLoadURL(nsIPresContext* aPresContext)
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsCOMPtr<nsIURI> uri;
|
nsCOMPtr<nsIURI> uri;
|
||||||
NS_NewURI(getter_AddRefs(uri), absURL.GetUnicode(), nsnull);
|
NS_NewURI(getter_AddRefs(uri), absURL, nsnull);
|
||||||
|
|
||||||
// Check for security
|
// Check for security
|
||||||
NS_WITH_SERVICE(nsIScriptSecurityManager, secMan,
|
NS_WITH_SERVICE(nsIScriptSecurityManager, secMan,
|
||||||
|
|
|
@ -3732,7 +3732,7 @@ HTMLContentSink::ProcessLink(nsIHTMLContent* aElement, const nsString& aLinkData
|
||||||
}
|
}
|
||||||
if (kNullCh != *equals) {
|
if (kNullCh != *equals) {
|
||||||
*equals = kNullCh;
|
*equals = kNullCh;
|
||||||
nsAutoString attr = start;
|
nsAutoString attr(start);
|
||||||
attr.StripWhitespace();
|
attr.StripWhitespace();
|
||||||
|
|
||||||
PRUnichar* value = ++equals;
|
PRUnichar* value = ++equals;
|
||||||
|
@ -4238,7 +4238,7 @@ HTMLContentSink::ProcessMETATag(const nsIParserNode& aNode)
|
||||||
if (!uriAttrib) {
|
if (!uriAttrib) {
|
||||||
uri = baseURI;
|
uri = baseURI;
|
||||||
} else {
|
} else {
|
||||||
rv = NS_NewURI(getter_AddRefs(uri), uriAttrib, baseURI);
|
rv = NS_NewURI(getter_AddRefs(uri), nsAutoString(uriAttrib), baseURI);
|
||||||
nsMemory::Free(uriAttrib);
|
nsMemory::Free(uriAttrib);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1573,7 +1573,7 @@ NS_IMETHODIMP CSSLoaderImpl::SetCharset(/*in*/ const nsString &aCharsetSrc)
|
||||||
} else {
|
} else {
|
||||||
NS_WITH_SERVICE(nsICharsetAlias, calias, kCharsetAliasCID, &rv);
|
NS_WITH_SERVICE(nsICharsetAlias, calias, kCharsetAliasCID, &rv);
|
||||||
NS_ASSERTION(calias, "cannot find charset alias");
|
NS_ASSERTION(calias, "cannot find charset alias");
|
||||||
nsAutoString charsetName = aCharsetSrc;
|
nsAutoString charsetName(aCharsetSrc);
|
||||||
if( NS_SUCCEEDED(rv) && (nsnull != calias))
|
if( NS_SUCCEEDED(rv) && (nsnull != calias))
|
||||||
{
|
{
|
||||||
PRBool same = PR_FALSE;
|
PRBool same = PR_FALSE;
|
||||||
|
|
|
@ -104,7 +104,7 @@ inline PRInt32 nsHTMLValue::GetIntValue(void) const
|
||||||
else if (mUnit == eHTMLUnit_String) {
|
else if (mUnit == eHTMLUnit_String) {
|
||||||
if (mValue.mString) {
|
if (mValue.mString) {
|
||||||
PRInt32 err=0;
|
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);
|
return str.ToInteger(&err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1573,7 +1573,7 @@ NS_IMETHODIMP CSSLoaderImpl::SetCharset(/*in*/ const nsString &aCharsetSrc)
|
||||||
} else {
|
} else {
|
||||||
NS_WITH_SERVICE(nsICharsetAlias, calias, kCharsetAliasCID, &rv);
|
NS_WITH_SERVICE(nsICharsetAlias, calias, kCharsetAliasCID, &rv);
|
||||||
NS_ASSERTION(calias, "cannot find charset alias");
|
NS_ASSERTION(calias, "cannot find charset alias");
|
||||||
nsAutoString charsetName = aCharsetSrc;
|
nsAutoString charsetName(aCharsetSrc);
|
||||||
if( NS_SUCCEEDED(rv) && (nsnull != calias))
|
if( NS_SUCCEEDED(rv) && (nsnull != calias))
|
||||||
{
|
{
|
||||||
PRBool same = PR_FALSE;
|
PRBool same = PR_FALSE;
|
||||||
|
|
|
@ -382,7 +382,7 @@ nsBindingManager::LoadBindingDocument(const nsString& aURL)
|
||||||
// Load the binding doc.
|
// Load the binding doc.
|
||||||
nsCString url; url.AssignWithConversion(aURL);
|
nsCString url; url.AssignWithConversion(aURL);
|
||||||
nsCOMPtr<nsIXBLDocumentInfo> info;
|
nsCOMPtr<nsIXBLDocumentInfo> info;
|
||||||
xblService->LoadBindingDocumentInfo(nsnull, url, "", PR_TRUE, getter_AddRefs(info));
|
xblService->LoadBindingDocumentInfo(nsnull, url, nsCAutoString(), PR_TRUE, getter_AddRefs(info));
|
||||||
if (!info)
|
if (!info)
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
|
|
|
@ -867,7 +867,7 @@ nsXBLBinding::InstallProperties(nsIContent* aBoundElement)
|
||||||
|
|
||||||
if (!getter.IsEmpty() && classObject) {
|
if (!getter.IsEmpty() && classObject) {
|
||||||
rv = context->CompileFunction(classObject,
|
rv = context->CompileFunction(classObject,
|
||||||
"onget",
|
nsCAutoString("onget"),
|
||||||
0,
|
0,
|
||||||
nsnull,
|
nsnull,
|
||||||
getter,
|
getter,
|
||||||
|
@ -901,7 +901,7 @@ nsXBLBinding::InstallProperties(nsIContent* aBoundElement)
|
||||||
|
|
||||||
if (!setter.IsEmpty() && classObject) {
|
if (!setter.IsEmpty() && classObject) {
|
||||||
rv = context->CompileFunction(classObject,
|
rv = context->CompileFunction(classObject,
|
||||||
"onset",
|
nsCAutoString("onset"),
|
||||||
1,
|
1,
|
||||||
gPropertyArg,
|
gPropertyArg,
|
||||||
setter,
|
setter,
|
||||||
|
|
|
@ -320,7 +320,7 @@ nsXBLStreamListener::Load(nsIDOMEvent* aEvent)
|
||||||
nsCOMPtr<nsIURI> uri(mBindingDocument->GetDocumentURL());
|
nsCOMPtr<nsIURI> uri(mBindingDocument->GetDocumentURL());
|
||||||
nsXPIDLCString str;
|
nsXPIDLCString str;
|
||||||
uri->GetSpec(getter_Copies(str));
|
uri->GetSpec(getter_Copies(str));
|
||||||
bindingManager->RemoveLoadingDocListener((const char*)str);
|
bindingManager->RemoveLoadingDocListener(nsCAutoString(NS_STATIC_CAST(const char*, str)));
|
||||||
|
|
||||||
nsCOMPtr<nsIContent> root = getter_AddRefs(mBindingDocument->GetRootContent());
|
nsCOMPtr<nsIContent> root = getter_AddRefs(mBindingDocument->GetRootContent());
|
||||||
if (root)
|
if (root)
|
||||||
|
@ -592,7 +592,7 @@ nsXBLService::LoadBindings(nsIContent* aContent, const nsString& aURL, PRBool aA
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!newBinding) {
|
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);
|
str.AppendWithConversion(aURL);
|
||||||
NS_ERROR(str);
|
NS_ERROR(str);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
@ -1057,7 +1057,7 @@ nsXBLService::FetchBindingDocument(nsIContent* aBoundElement, nsIURI* aURI, cons
|
||||||
boundDocument->GetBindingManager(getter_AddRefs(bindingManager));
|
boundDocument->GetBindingManager(getter_AddRefs(bindingManager));
|
||||||
nsXPIDLCString uri;
|
nsXPIDLCString uri;
|
||||||
aURI->GetSpec(getter_Copies(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.
|
// Add our request.
|
||||||
nsCAutoString bindingURI(uri);
|
nsCAutoString bindingURI(uri);
|
||||||
|
|
|
@ -2006,7 +2006,7 @@ nsXMLContentSink::GetElementFactory(PRInt32 aNameSpaceID, nsIElementFactory** aR
|
||||||
nsAutoString nameSpace;
|
nsAutoString nameSpace;
|
||||||
gNameSpaceManager->GetNameSpaceURI(aNameSpaceID, nameSpace);
|
gNameSpaceManager->GetNameSpaceURI(aNameSpaceID, nameSpace);
|
||||||
|
|
||||||
nsCAutoString progID = NS_ELEMENT_FACTORY_PROGID_PREFIX;
|
nsCAutoString progID( NS_ELEMENT_FACTORY_PROGID_PREFIX );
|
||||||
progID.AppendWithConversion(nameSpace);
|
progID.AppendWithConversion(nameSpace);
|
||||||
|
|
||||||
// Retrieve the appropriate factory.
|
// Retrieve the appropriate factory.
|
||||||
|
|
|
@ -136,7 +136,7 @@ nsPopupSetBoxObject::CreatePopup(nsIDOMElement* aSrcContent,
|
||||||
if (!shell)
|
if (!shell)
|
||||||
return NS_OK;
|
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)
|
NS_IMETHODIMP nsPopupSetBoxObject::GetActiveChild(nsIDOMElement** aResult)
|
||||||
|
|
|
@ -441,7 +441,7 @@ nsTextBoxFrame::CalculateTitleForWidth(nsIPresContext* aPresContext, nsIRenderin
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// insert what character we can in.
|
// insert what character we can in.
|
||||||
nsAutoString title = mTitle;
|
nsAutoString title( mTitle );
|
||||||
title.Truncate(i);
|
title.Truncate(i);
|
||||||
mCroppedTitle.Insert(title, 0);
|
mCroppedTitle.Insert(title, 0);
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче