зеркало из https://github.com/mozilla/pjs.git
making string conversions explicit
This commit is contained in:
Родитель
649e910e55
Коммит
6f4c241bfa
|
@ -172,7 +172,7 @@ NS_IMETHODIMP
|
|||
nsDOMException::GetMessage(nsString& aMessage)
|
||||
{
|
||||
if (mMessage) {
|
||||
aMessage.Assign(mMessage);
|
||||
aMessage.AssignWithConversion(mMessage);
|
||||
}
|
||||
else {
|
||||
aMessage.Truncate();
|
||||
|
@ -185,7 +185,7 @@ NS_IMETHODIMP
|
|||
nsDOMException::GetName(nsString& aName)
|
||||
{
|
||||
if (mName) {
|
||||
aName.Assign(mName);
|
||||
aName.AssignWithConversion(mName);
|
||||
}
|
||||
else {
|
||||
aName.Truncate();
|
||||
|
@ -211,7 +211,7 @@ nsDOMException::ToString(nsString& aReturn)
|
|||
GetCode(&code);
|
||||
char* temp = PR_smprintf(format, msg, code, mResult, resultName, location);
|
||||
if (temp) {
|
||||
aReturn.Assign(temp);
|
||||
aReturn.AssignWithConversion(temp);
|
||||
PR_smprintf_free(temp);
|
||||
}
|
||||
|
||||
|
|
|
@ -224,10 +224,10 @@ NS_IMETHODIMP GlobalWindowImpl::SetNewDocument(nsIDOMDocument *aDocument)
|
|||
char* str;
|
||||
docURL->GetSpec(&str);
|
||||
|
||||
nsAutoString url(str);
|
||||
nsAutoString url; url.AssignWithConversion(str);
|
||||
|
||||
//about:blank URL's do not have ClearScope called on page change.
|
||||
if(!url.Equals("about:blank"))
|
||||
if(!url.EqualsWithConversion("about:blank"))
|
||||
{
|
||||
ClearAllTimeouts();
|
||||
|
||||
|
@ -1119,7 +1119,7 @@ NS_IMETHODIMP GlobalWindowImpl::Alert(JSContext* cx, jsval* argv, PRUint32 argc)
|
|||
if(argc > 0)
|
||||
nsJSUtils::nsConvertJSValToString(str, cx, argv[0]);
|
||||
else
|
||||
str.Assign("undefined");
|
||||
str.AssignWithConversion("undefined");
|
||||
|
||||
nsCOMPtr<nsIDocShellTreeOwner> treeOwner;
|
||||
GetTreeOwner(getter_AddRefs(treeOwner));
|
||||
|
@ -1142,7 +1142,7 @@ NS_IMETHODIMP GlobalWindowImpl::Confirm(JSContext* cx, jsval* argv,
|
|||
if(argc > 0)
|
||||
nsJSUtils::nsConvertJSValToString(str, cx, argv[0]);
|
||||
else
|
||||
str.Assign("undefined");
|
||||
str.AssignWithConversion("undefined");
|
||||
|
||||
nsCOMPtr<nsIDocShellTreeOwner> treeOwner;
|
||||
GetTreeOwner(getter_AddRefs(treeOwner));
|
||||
|
@ -1170,7 +1170,7 @@ NS_IMETHODIMP GlobalWindowImpl::Prompt(JSContext* cx, jsval* argv,
|
|||
if(argc > 1)
|
||||
nsJSUtils::nsConvertJSValToString(initial, cx, argv[1]);
|
||||
else
|
||||
initial.Assign("undefined");
|
||||
initial.AssignWithConversion("undefined");
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocShellTreeOwner> treeOwner;
|
||||
|
@ -1191,7 +1191,7 @@ NS_IMETHODIMP GlobalWindowImpl::Prompt(JSContext* cx, jsval* argv,
|
|||
// XXX Need to check return value and return null if the
|
||||
// user hits cancel. Currently, we can only return a
|
||||
// string reference.
|
||||
aReturn.Assign("");
|
||||
aReturn.SetLength(0);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@ -1285,10 +1285,10 @@ NS_IMETHODIMP GlobalWindowImpl::Home()
|
|||
#ifdef DEBUG_seth
|
||||
printf("all else failed. using %s as the home page\n",DEFAULT_HOME_PAGE);
|
||||
#endif
|
||||
homeURL = DEFAULT_HOME_PAGE;
|
||||
homeURL.AssignWithConversion(DEFAULT_HOME_PAGE);
|
||||
}
|
||||
else
|
||||
homeURL = url;
|
||||
homeURL.AssignWithConversion(url);
|
||||
PR_FREEIF(url);
|
||||
nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(mDocShell));
|
||||
NS_ENSURE_TRUE(webNav, NS_ERROR_FAILURE);
|
||||
|
@ -1633,7 +1633,7 @@ NS_IMETHODIMP GlobalWindowImpl::Escape(const nsString& aStr, nsString& aReturn)
|
|||
NS_ENSURE_TRUE(ccm, NS_ERROR_FAILURE);
|
||||
|
||||
// Get the document character set
|
||||
charset = "UTF-8"; // default to utf-8
|
||||
charset.AssignWithConversion("UTF-8"); // default to utf-8
|
||||
if(mDocument)
|
||||
{
|
||||
nsCOMPtr<nsIDocument> doc(do_QueryInterface(mDocument));
|
||||
|
@ -1683,7 +1683,7 @@ NS_IMETHODIMP GlobalWindowImpl::Escape(const nsString& aStr, nsString& aReturn)
|
|||
|
||||
// Escape the string
|
||||
char* outBuf = nsEscape(dest, nsEscapeMask(url_XAlphas | url_XPAlphas | url_Path));
|
||||
aReturn.Assign(outBuf);
|
||||
aReturn.AssignWithConversion(outBuf);
|
||||
|
||||
nsAllocator::Free(outBuf);
|
||||
nsAllocator::Free(dest);
|
||||
|
@ -1701,7 +1701,7 @@ NS_IMETHODIMP GlobalWindowImpl::Unescape(const nsString& aStr, nsString& aReturn
|
|||
NS_ENSURE_TRUE(ccm, NS_ERROR_FAILURE);
|
||||
|
||||
// Get the document character set
|
||||
charset = "UTF-8"; // default to utf-8
|
||||
charset.AssignWithConversion("UTF-8"); // default to utf-8
|
||||
if(mDocument)
|
||||
{
|
||||
nsCOMPtr<nsIDocument> doc(do_QueryInterface(mDocument));
|
||||
|
@ -1779,7 +1779,7 @@ PRBool GlobalWindowImpl::AddProperty(JSContext* aContext, JSObject* aObj,
|
|||
mPropName.Assign(JS_GetStringChars(JS_ValueToString(aContext, aID)));
|
||||
if(mPropName.Length() > 2)
|
||||
mPrefix.Assign(mPropName.GetUnicode(), 2);
|
||||
if(mPrefix.Equals("on"))
|
||||
if(mPrefix.EqualsWithConversion("on"))
|
||||
return CheckForEventListener(aContext, mPropName);
|
||||
}
|
||||
return PR_TRUE;
|
||||
|
@ -1949,7 +1949,7 @@ PRBool GlobalWindowImpl::Resolve(JSContext* aContext, JSObject* aObj, jsval aID)
|
|||
if(NS_SUCCEEDED(docShellAsNode->GetChildCount(&count)) && count)
|
||||
{
|
||||
nsCOMPtr<nsIDocShellTreeItem> child;
|
||||
nsAutoString name(JS_GetStringBytes(JS_ValueToString(aContext, aID)));
|
||||
nsAutoString name; name.AssignWithConversion(JS_GetStringBytes(JS_ValueToString(aContext, aID)));
|
||||
if(NS_SUCCEEDED(docShellAsNode->FindChildWithName(name.GetUnicode(),
|
||||
PR_FALSE, PR_FALSE, nsnull, getter_AddRefs(child))))
|
||||
{
|
||||
|
@ -2360,7 +2360,7 @@ NS_IMETHODIMP GlobalWindowImpl::OpenInternal(JSContext* cx, jsval* argv,
|
|||
nsAutoString mURL;
|
||||
mURL.Assign(JS_GetStringChars(mJSStrURL));
|
||||
|
||||
if(!mURL.Equals(""))
|
||||
if(!mURL.IsEmpty())
|
||||
{
|
||||
nsAutoString mAbsURL;
|
||||
if(mDocument)
|
||||
|
@ -3110,7 +3110,7 @@ PRBool GlobalWindowImpl::RunTimeout(nsTimeoutImpl *aTimeout)
|
|||
if(timeout->expr) {
|
||||
/* Evaluate the timeout expression. */
|
||||
nsAutoString script = JS_GetStringChars(timeout->expr);
|
||||
nsAutoString blank = "";
|
||||
nsAutoString blank;
|
||||
PRBool isUndefined;
|
||||
rv = mContext->EvaluateString(script,
|
||||
mScriptObject,
|
||||
|
@ -3462,9 +3462,9 @@ PRBool GlobalWindowImpl::CheckForEventListener(JSContext* aContext, nsString& aP
|
|||
|
||||
// XXX Comparisons should really be atom based
|
||||
|
||||
if(aPropName.Equals("onmousedown") || aPropName.Equals("onmouseup") ||
|
||||
aPropName.Equals("onclick") || aPropName.Equals("onmouseover") ||
|
||||
aPropName.Equals("onmouseout"))
|
||||
if(aPropName.EqualsWithConversion("onmousedown") || aPropName.EqualsWithConversion("onmouseup") ||
|
||||
aPropName.EqualsWithConversion("onclick") || aPropName.EqualsWithConversion("onmouseover") ||
|
||||
aPropName.EqualsWithConversion("onmouseout"))
|
||||
{
|
||||
if(NS_OK == GetListenerManager(getter_AddRefs(manager)))
|
||||
{
|
||||
|
@ -3478,8 +3478,8 @@ PRBool GlobalWindowImpl::CheckForEventListener(JSContext* aContext, nsString& aP
|
|||
}
|
||||
}
|
||||
}
|
||||
else if(aPropName.Equals("onkeydown") || aPropName.Equals("onkeyup") ||
|
||||
aPropName.Equals("onkeypress"))
|
||||
else if(aPropName.EqualsWithConversion("onkeydown") || aPropName.EqualsWithConversion("onkeyup") ||
|
||||
aPropName.EqualsWithConversion("onkeypress"))
|
||||
{
|
||||
if(NS_OK == GetListenerManager(getter_AddRefs(manager)))
|
||||
{
|
||||
|
@ -3494,7 +3494,7 @@ PRBool GlobalWindowImpl::CheckForEventListener(JSContext* aContext, nsString& aP
|
|||
}
|
||||
}
|
||||
}
|
||||
else if(aPropName.Equals("onmousemove"))
|
||||
else if(aPropName.EqualsWithConversion("onmousemove"))
|
||||
{
|
||||
if(NS_OK == GetListenerManager(getter_AddRefs(manager)))
|
||||
{
|
||||
|
@ -3509,7 +3509,7 @@ PRBool GlobalWindowImpl::CheckForEventListener(JSContext* aContext, nsString& aP
|
|||
}
|
||||
}
|
||||
}
|
||||
else if(aPropName.Equals("onfocus") || aPropName.Equals("onblur"))
|
||||
else if(aPropName.EqualsWithConversion("onfocus") || aPropName.EqualsWithConversion("onblur"))
|
||||
{
|
||||
if(NS_OK == GetListenerManager(getter_AddRefs(manager)))
|
||||
{
|
||||
|
@ -3524,8 +3524,8 @@ PRBool GlobalWindowImpl::CheckForEventListener(JSContext* aContext, nsString& aP
|
|||
}
|
||||
}
|
||||
}
|
||||
else if(aPropName.Equals("onsubmit") || aPropName.Equals("onreset") ||
|
||||
aPropName.Equals("onchange") || aPropName.Equals("onselect"))
|
||||
else if(aPropName.EqualsWithConversion("onsubmit") || aPropName.EqualsWithConversion("onreset") ||
|
||||
aPropName.EqualsWithConversion("onchange") || aPropName.EqualsWithConversion("onselect"))
|
||||
{
|
||||
if(NS_OK == GetListenerManager(getter_AddRefs(manager)))
|
||||
{
|
||||
|
@ -3540,9 +3540,9 @@ PRBool GlobalWindowImpl::CheckForEventListener(JSContext* aContext, nsString& aP
|
|||
}
|
||||
}
|
||||
}
|
||||
else if(aPropName.Equals("onload") || aPropName.Equals("onunload") ||
|
||||
aPropName.Equals("onclose") || aPropName.Equals("onabort") ||
|
||||
aPropName.Equals("onerror"))
|
||||
else if(aPropName.EqualsWithConversion("onload") || aPropName.EqualsWithConversion("onunload") ||
|
||||
aPropName.EqualsWithConversion("onclose") || aPropName.EqualsWithConversion("onabort") ||
|
||||
aPropName.EqualsWithConversion("onerror"))
|
||||
{
|
||||
if(NS_OK == GetListenerManager(getter_AddRefs(manager)))
|
||||
{
|
||||
|
@ -3557,7 +3557,7 @@ PRBool GlobalWindowImpl::CheckForEventListener(JSContext* aContext, nsString& aP
|
|||
}
|
||||
}
|
||||
}
|
||||
else if(aPropName.Equals("onpaint"))
|
||||
else if(aPropName.EqualsWithConversion("onpaint"))
|
||||
{
|
||||
if(NS_OK == GetListenerManager(getter_AddRefs(manager)))
|
||||
{
|
||||
|
@ -3702,14 +3702,14 @@ NS_IMETHODIMP NavigatorImpl::GetAppVersion(nsString& aAppVersion)
|
|||
aAppVersion = str;
|
||||
Recycle(str);
|
||||
|
||||
aAppVersion += " (";
|
||||
aAppVersion.AppendWithConversion(" (");
|
||||
res = service->GetPlatform(&str);
|
||||
if(NS_FAILED(res)) return res;
|
||||
|
||||
aAppVersion += str;
|
||||
Recycle(str);
|
||||
|
||||
aAppVersion += "; ";
|
||||
aAppVersion.AppendWithConversion("; ");
|
||||
|
||||
res = service->GetLanguage(&str);
|
||||
if (NS_FAILED(res)) return res;
|
||||
|
@ -3725,7 +3725,7 @@ NS_IMETHODIMP NavigatorImpl::GetAppVersion(nsString& aAppVersion)
|
|||
|
||||
NS_IMETHODIMP NavigatorImpl::GetAppName(nsString& aAppName)
|
||||
{
|
||||
aAppName = "Netscape";
|
||||
aAppName.AssignWithConversion("Netscape");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -4142,19 +4142,19 @@ NS_IMETHODIMP nsDOMWindowController::IsCommandEnabled(const PRUnichar *aCommand,
|
|||
if ( NS_FAILED (rv ) )
|
||||
return rv;
|
||||
|
||||
if (PR_TRUE== nsAutoString(sCopyString).Equals(aCommand))
|
||||
if (PR_TRUE== NS_ConvertToString(sCopyString).Equals(aCommand))
|
||||
{
|
||||
rv = editInterface->GetCopyable( aResult );
|
||||
}
|
||||
else if (PR_TRUE==nsAutoString(sCutString).Equals(aCommand))
|
||||
else if (PR_TRUE==NS_ConvertToString(sCutString).Equals(aCommand))
|
||||
{
|
||||
rv = editInterface->GetCutable( aResult);
|
||||
}
|
||||
else if (PR_TRUE==nsAutoString(sPasteString).Equals(aCommand))
|
||||
else if (PR_TRUE==NS_ConvertToString(sPasteString).Equals(aCommand))
|
||||
{
|
||||
rv = editInterface->GetPasteable( aResult );
|
||||
}
|
||||
else if (PR_TRUE==nsAutoString(sSelectAllString).Equals(aCommand))
|
||||
else if (PR_TRUE==NS_ConvertToString(sSelectAllString).Equals(aCommand))
|
||||
{
|
||||
*aResult = PR_TRUE;
|
||||
rv = NS_OK;
|
||||
|
@ -4170,40 +4170,40 @@ NS_IMETHODIMP nsDOMWindowController::SupportsCommand(const PRUnichar *aCommand,
|
|||
|
||||
*aResult = PR_FALSE;
|
||||
if (
|
||||
(PR_TRUE== nsAutoString(sCopyString).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sSelectAllString).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sCutString).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sPasteString).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sBeginLineString).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sEndLineString).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sSelectBeginLineString).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sSelectEndLineString).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sScrollTopString).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sScrollBottomString).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sMoveTopString).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sMoveBottomString).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sSelectMoveTopString).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sSelectMoveBottomString).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sDownString).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sUpString).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sLeftString).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sRightString).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sSelectDownString).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sSelectUpString).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sSelectLeftString).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sSelectRightString).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sWordLeftString).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sWordRightString).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sSelectWordLeftString).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sSelectWordRightString).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sScrollPageUp).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sScrollPageDown).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sScrollLineUp).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sScrollLineDown).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sMovePageUp).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sMovePageDown).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sSelectMovePageUp).Equals(aCommand)) ||
|
||||
(PR_TRUE== nsAutoString(sSelectMovePageDown).Equals(aCommand))
|
||||
(PR_TRUE== NS_ConvertToString(sCopyString).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sSelectAllString).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sCutString).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sPasteString).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sBeginLineString).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sEndLineString).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sSelectBeginLineString).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sSelectEndLineString).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sScrollTopString).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sScrollBottomString).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sMoveTopString).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sMoveBottomString).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sSelectMoveTopString).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sSelectMoveBottomString).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sDownString).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sUpString).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sLeftString).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sRightString).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sSelectDownString).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sSelectUpString).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sSelectLeftString).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sSelectRightString).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sWordLeftString).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sWordRightString).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sSelectWordLeftString).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sSelectWordRightString).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sScrollPageUp).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sScrollPageDown).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sScrollLineUp).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sScrollLineDown).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sMovePageUp).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sMovePageDown).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sSelectMovePageUp).Equals(aCommand)) ||
|
||||
(PR_TRUE== NS_ConvertToString(sSelectMovePageDown).Equals(aCommand))
|
||||
)
|
||||
{
|
||||
*aResult = PR_TRUE;
|
||||
|
@ -4223,38 +4223,38 @@ NS_IMETHODIMP nsDOMWindowController::DoCommand(const PRUnichar *aCommand)
|
|||
if ( NS_FAILED ( rv ) )
|
||||
return rv;
|
||||
|
||||
if (PR_TRUE== nsAutoString(sCopyString).Equals(aCommand))
|
||||
if (PR_TRUE== NS_ConvertToString(sCopyString).Equals(aCommand))
|
||||
{
|
||||
rv = editInterface->CopySelection();
|
||||
}
|
||||
else if (PR_TRUE== nsAutoString(sCutString).Equals(aCommand))
|
||||
else if (PR_TRUE== NS_ConvertToString(sCutString).Equals(aCommand))
|
||||
{
|
||||
rv = editInterface->CutSelection();
|
||||
}
|
||||
else if (PR_TRUE== nsAutoString(sPasteString).Equals(aCommand))
|
||||
else if (PR_TRUE== NS_ConvertToString(sPasteString).Equals(aCommand))
|
||||
{
|
||||
rv = editInterface->Paste();
|
||||
}
|
||||
else if (PR_TRUE== nsAutoString(sSelectAllString).Equals(aCommand))
|
||||
else if (PR_TRUE== NS_ConvertToString(sSelectAllString).Equals(aCommand))
|
||||
{
|
||||
rv = editInterface->SelectAll();
|
||||
}
|
||||
else if (PR_TRUE==nsAutoString(sScrollPageUp).Equals(aCommand)) //ScrollPageUp
|
||||
else if (PR_TRUE==NS_ConvertToString(sScrollPageUp).Equals(aCommand)) //ScrollPageUp
|
||||
{
|
||||
NS_ENSURE_SUCCESS(GetSelectionController(getter_AddRefs(selCont)),NS_ERROR_FAILURE);
|
||||
return selCont->ScrollPage(PR_FALSE);
|
||||
}
|
||||
else if (PR_TRUE==nsAutoString(sScrollPageDown).Equals(aCommand)) //ScrollPageDown
|
||||
else if (PR_TRUE==NS_ConvertToString(sScrollPageDown).Equals(aCommand)) //ScrollPageDown
|
||||
{
|
||||
NS_ENSURE_SUCCESS(GetSelectionController(getter_AddRefs(selCont)),NS_ERROR_FAILURE);
|
||||
return selCont->ScrollPage(PR_TRUE);
|
||||
}
|
||||
else if (PR_TRUE==nsAutoString(sScrollLineUp).Equals(aCommand)) //ScrollLineUp
|
||||
else if (PR_TRUE==NS_ConvertToString(sScrollLineUp).Equals(aCommand)) //ScrollLineUp
|
||||
{
|
||||
NS_ENSURE_SUCCESS(GetSelectionController(getter_AddRefs(selCont)),NS_ERROR_FAILURE);
|
||||
return selCont->ScrollLine(PR_FALSE);
|
||||
}
|
||||
else if (PR_TRUE==nsAutoString(sScrollLineDown).Equals(aCommand)) //ScrollLineDown
|
||||
else if (PR_TRUE==NS_ConvertToString(sScrollLineDown).Equals(aCommand)) //ScrollLineDown
|
||||
{
|
||||
NS_ENSURE_SUCCESS(GetSelectionController(getter_AddRefs(selCont)),NS_ERROR_FAILURE);
|
||||
return selCont->ScrollLine(PR_TRUE);
|
||||
|
|
|
@ -178,7 +178,7 @@ HistoryImpl::Go(JSContext* cx, jsval* argv, PRUint32 argc)
|
|||
PRInt32 i, count;
|
||||
|
||||
if (nsnull != jsstr) {
|
||||
nsAutoString substr(JS_GetStringBytes(jsstr));
|
||||
nsAutoString substr; substr.AssignWithConversion(JS_GetStringBytes(jsstr));
|
||||
|
||||
result = webShell->GetHistoryLength(count);
|
||||
for (i = 0; (i < count) && NS_SUCCEEDED(result); i++) {
|
||||
|
|
|
@ -104,10 +104,10 @@ GetMimeTypeArrayProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
|
||||
JSString *jsstring = JS_ValueToString(cx, id);
|
||||
if (nsnull != jsstring) {
|
||||
name.SetString(JS_GetStringChars(jsstring));
|
||||
name.Assign(JS_GetStringChars(jsstring));
|
||||
}
|
||||
else {
|
||||
name.SetString("");
|
||||
name.SetLength(0);
|
||||
}
|
||||
|
||||
result = a->NamedItem(name, &prop);
|
||||
|
|
|
@ -143,10 +143,10 @@ GetPluginProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
|
||||
JSString *jsstring = JS_ValueToString(cx, id);
|
||||
if (nsnull != jsstring) {
|
||||
name.SetString(JS_GetStringChars(jsstring));
|
||||
name.Assign(JS_GetStringChars(jsstring));
|
||||
}
|
||||
else {
|
||||
name.SetString("");
|
||||
name.SetLength(0);
|
||||
}
|
||||
|
||||
result = a->NamedItem(name, &prop);
|
||||
|
|
|
@ -104,10 +104,10 @@ GetPluginArrayProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
|
||||
JSString *jsstring = JS_ValueToString(cx, id);
|
||||
if (nsnull != jsstring) {
|
||||
name.SetString(JS_GetStringChars(jsstring));
|
||||
name.Assign(JS_GetStringChars(jsstring));
|
||||
}
|
||||
else {
|
||||
name.SetString("");
|
||||
name.SetLength(0);
|
||||
}
|
||||
|
||||
result = a->NamedItem(name, &prop);
|
||||
|
|
|
@ -554,7 +554,7 @@ SetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
if (NS_SUCCEEDED(rv)) {
|
||||
nsIDOMWindow* prop;
|
||||
if (PR_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&prop,
|
||||
kIWindowIID, "Window",
|
||||
kIWindowIID, NS_ConvertToString("Window"),
|
||||
cx, *vp)) {
|
||||
rv = NS_ERROR_DOM_NOT_OBJECT_ERR;
|
||||
}
|
||||
|
@ -2036,7 +2036,7 @@ WindowRouteEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
|
|||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b0),
|
||||
kIEventIID,
|
||||
"Event",
|
||||
NS_ConvertToString("Event"),
|
||||
cx,
|
||||
argv[0])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
|
|
|
@ -104,10 +104,10 @@ GetWindowCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
|
||||
JSString *jsstring = JS_ValueToString(cx, id);
|
||||
if (nsnull != jsstring) {
|
||||
name.SetString(JS_GetStringChars(jsstring));
|
||||
name.Assign(JS_GetStringChars(jsstring));
|
||||
}
|
||||
else {
|
||||
name.SetString("");
|
||||
name.SetLength(0);
|
||||
}
|
||||
|
||||
result = a->NamedItem(name, &prop);
|
||||
|
|
|
@ -182,8 +182,8 @@ LocationImpl::GetHash(nsString& aHash)
|
|||
NS_RELEASE(url);
|
||||
}
|
||||
if (result == NS_OK && (nsnull != ref) && ('\0' != *ref)) {
|
||||
aHash.Assign("#");
|
||||
aHash.Append(ref);
|
||||
aHash.AssignWithConversion("#");
|
||||
aHash.AppendWithConversion(ref);
|
||||
nsCRT::free(ref);
|
||||
}
|
||||
else {
|
||||
|
@ -236,13 +236,13 @@ LocationImpl::GetHost(nsString& aHost)
|
|||
char* host;
|
||||
result = url->GetHost(&host);
|
||||
if (result == NS_OK) {
|
||||
aHost.Assign(host);
|
||||
aHost.AssignWithConversion(host);
|
||||
nsCRT::free(host);
|
||||
PRInt32 port;
|
||||
(void)url->GetPort(&port);
|
||||
if (-1 != port) {
|
||||
aHost.Append(":");
|
||||
aHost.Append(port, 10);
|
||||
aHost.AppendWithConversion(":");
|
||||
aHost.AppendWithConversion(port, 10);
|
||||
}
|
||||
}
|
||||
NS_RELEASE(url);
|
||||
|
@ -288,7 +288,7 @@ LocationImpl::GetHostname(nsString& aHostname)
|
|||
char* host;
|
||||
result = url->GetHost(&host);
|
||||
if (result == NS_OK) {
|
||||
aHostname.Assign(host);
|
||||
aHostname.AssignWithConversion(host);
|
||||
nsCRT::free(host);
|
||||
}
|
||||
NS_RELEASE(url);
|
||||
|
@ -332,7 +332,7 @@ LocationImpl::GetHref(nsString& aHref)
|
|||
nsXPIDLCString uriString;
|
||||
result = uri->GetSpec(getter_Copies(uriString));
|
||||
if (NS_SUCCEEDED(result))
|
||||
aHref = uriString;
|
||||
aHref.AssignWithConversion(uriString);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -401,7 +401,7 @@ LocationImpl::GetPathname(nsString& aPathname)
|
|||
char* file;
|
||||
result = url->GetPath(&file);
|
||||
if (result == NS_OK) {
|
||||
aPathname.Assign(file);
|
||||
aPathname.AssignWithConversion(file);
|
||||
nsCRT::free(file);
|
||||
}
|
||||
NS_IF_RELEASE(url);
|
||||
|
@ -448,7 +448,7 @@ LocationImpl::GetPort(nsString& aPort)
|
|||
PRInt32 port;
|
||||
(void)url->GetPort(&port);
|
||||
if (-1 != port) {
|
||||
aPort.Append(port, 10);
|
||||
aPort.AppendWithConversion(port, 10);
|
||||
}
|
||||
NS_RELEASE(url);
|
||||
}
|
||||
|
@ -503,8 +503,8 @@ LocationImpl::GetProtocol(nsString& aProtocol)
|
|||
char* protocol;
|
||||
result = url->GetScheme(&protocol);
|
||||
if (result == NS_OK) {
|
||||
aProtocol.Assign(protocol);
|
||||
aProtocol.Append(":");
|
||||
aProtocol.AssignWithConversion(protocol);
|
||||
aProtocol.AppendWithConversion(":");
|
||||
nsCRT::free(protocol);
|
||||
}
|
||||
NS_RELEASE(url);
|
||||
|
@ -555,8 +555,8 @@ LocationImpl::GetSearch(nsString& aSearch)
|
|||
NS_RELEASE(url);
|
||||
}
|
||||
if (result == NS_OK && (nsnull != search) && ('\0' != *search)) {
|
||||
aSearch.Assign("?");
|
||||
aSearch.Append(search);
|
||||
aSearch.AssignWithConversion("?");
|
||||
aSearch.AppendWithConversion(search);
|
||||
nsCRT::free(search);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -270,7 +270,7 @@ DOMImplementationCreateDocument(JSContext *cx, JSObject *obj, uintN argc, jsval
|
|||
nsJSUtils::nsConvertJSValToString(b1, cx, argv[1]);
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b2),
|
||||
kIDocumentTypeIID,
|
||||
"DocumentType",
|
||||
NS_ConvertToString("DocumentType"),
|
||||
cx,
|
||||
argv[2])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
|
|
|
@ -704,7 +704,7 @@ DocumentImportNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b0),
|
||||
kINodeIID,
|
||||
"Node",
|
||||
NS_ConvertToString("Node"),
|
||||
cx,
|
||||
argv[0])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
|
|
|
@ -361,7 +361,7 @@ ElementSetAttributeNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b0),
|
||||
kIAttrIID,
|
||||
"Attr",
|
||||
NS_ConvertToString("Attr"),
|
||||
cx,
|
||||
argv[0])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
|
@ -409,7 +409,7 @@ ElementRemoveAttributeNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
|
|||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b0),
|
||||
kIAttrIID,
|
||||
"Attr",
|
||||
NS_ConvertToString("Attr"),
|
||||
cx,
|
||||
argv[0])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
|
|
|
@ -240,7 +240,7 @@ NamedNodeMapSetNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b0),
|
||||
kINodeIID,
|
||||
"Node",
|
||||
NS_ConvertToString("Node"),
|
||||
cx,
|
||||
argv[0])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
|
|
|
@ -400,14 +400,14 @@ NodeInsertBefore(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
|
|||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b0),
|
||||
kINodeIID,
|
||||
"Node",
|
||||
NS_ConvertToString("Node"),
|
||||
cx,
|
||||
argv[0])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
}
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b1),
|
||||
kINodeIID,
|
||||
"Node",
|
||||
NS_ConvertToString("Node"),
|
||||
cx,
|
||||
argv[1])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
|
@ -456,14 +456,14 @@ NodeReplaceChild(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
|
|||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b0),
|
||||
kINodeIID,
|
||||
"Node",
|
||||
NS_ConvertToString("Node"),
|
||||
cx,
|
||||
argv[0])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
}
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b1),
|
||||
kINodeIID,
|
||||
"Node",
|
||||
NS_ConvertToString("Node"),
|
||||
cx,
|
||||
argv[1])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
|
@ -511,7 +511,7 @@ NodeRemoveChild(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
|
|||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b0),
|
||||
kINodeIID,
|
||||
"Node",
|
||||
NS_ConvertToString("Node"),
|
||||
cx,
|
||||
argv[0])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
|
@ -559,7 +559,7 @@ NodeAppendChild(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
|
|||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b0),
|
||||
kINodeIID,
|
||||
"Node",
|
||||
NS_ConvertToString("Node"),
|
||||
cx,
|
||||
argv[0])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
|
|
|
@ -123,7 +123,7 @@ SetCSSFontFaceRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
if (NS_SUCCEEDED(rv)) {
|
||||
nsIDOMCSSStyleDeclaration* prop;
|
||||
if (PR_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&prop,
|
||||
kICSSStyleDeclarationIID, "CSSStyleDeclaration",
|
||||
kICSSStyleDeclarationIID, NS_ConvertToString("CSSStyleDeclaration"),
|
||||
cx, *vp)) {
|
||||
rv = NS_ERROR_DOM_NOT_OBJECT_ERR;
|
||||
}
|
||||
|
|
|
@ -148,7 +148,7 @@ SetCSSPageRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
if (NS_SUCCEEDED(rv)) {
|
||||
nsIDOMCSSStyleDeclaration* prop;
|
||||
if (PR_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&prop,
|
||||
kICSSStyleDeclarationIID, "CSSStyleDeclaration",
|
||||
kICSSStyleDeclarationIID, NS_ConvertToString("CSSStyleDeclaration"),
|
||||
cx, *vp)) {
|
||||
rv = NS_ERROR_DOM_NOT_OBJECT_ERR;
|
||||
}
|
||||
|
|
|
@ -148,7 +148,7 @@ SetCSSStyleRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
if (NS_SUCCEEDED(rv)) {
|
||||
nsIDOMCSSStyleDeclaration* prop;
|
||||
if (PR_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&prop,
|
||||
kICSSStyleDeclarationIID, "CSSStyleDeclaration",
|
||||
kICSSStyleDeclarationIID, NS_ConvertToString("CSSStyleDeclaration"),
|
||||
cx, *vp)) {
|
||||
rv = NS_ERROR_DOM_NOT_OBJECT_ERR;
|
||||
}
|
||||
|
|
|
@ -99,7 +99,7 @@ nsresult nsJSEventListener::HandleEvent(nsIDOMEvent* aEvent)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
eventString.Insert("on", 0, 2);
|
||||
eventString.InsertWithConversion("on", 0, 2);
|
||||
eventChars = eventString.ToNewCString();
|
||||
|
||||
result = mOwner->GetScriptObject(mContext, (void**)&obj);
|
||||
|
|
|
@ -434,7 +434,7 @@ KeyEventInitKeyEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
|
|||
}
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b9),
|
||||
kIAbstractViewIID,
|
||||
"AbstractView",
|
||||
NS_ConvertToString("AbstractView"),
|
||||
cx,
|
||||
argv[9])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
|
|
|
@ -421,7 +421,7 @@ UIEventInitUIEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
}
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b3),
|
||||
kIAbstractViewIID,
|
||||
"AbstractView",
|
||||
NS_ConvertToString("AbstractView"),
|
||||
cx,
|
||||
argv[3])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
|
|
|
@ -104,10 +104,10 @@ GetHTMLCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
|
||||
JSString *jsstring = JS_ValueToString(cx, id);
|
||||
if (nsnull != jsstring) {
|
||||
name.SetString(JS_GetStringChars(jsstring));
|
||||
name.Assign(JS_GetStringChars(jsstring));
|
||||
}
|
||||
else {
|
||||
name.SetString("");
|
||||
name.SetLength(0);
|
||||
}
|
||||
|
||||
result = a->NamedItem(name, &prop);
|
||||
|
|
|
@ -471,7 +471,7 @@ SetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
if (NS_SUCCEEDED(rv)) {
|
||||
nsIDOMHTMLElement* prop;
|
||||
if (PR_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&prop,
|
||||
kIHTMLElementIID, "HTMLElement",
|
||||
kIHTMLElementIID, NS_ConvertToString("HTMLElement"),
|
||||
cx, *vp)) {
|
||||
rv = NS_ERROR_DOM_NOT_OBJECT_ERR;
|
||||
}
|
||||
|
@ -1086,7 +1086,7 @@ NSHTMLDocumentRouteEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b0),
|
||||
kIEventIID,
|
||||
"Event",
|
||||
NS_ConvertToString("Event"),
|
||||
cx,
|
||||
argv[0])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
|
|
|
@ -325,7 +325,7 @@ SetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
if (NS_SUCCEEDED(rv)) {
|
||||
nsIDOMDocument* prop;
|
||||
if (PR_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&prop,
|
||||
kIDocumentIID, "Document",
|
||||
kIDocumentIID, NS_ConvertToString("Document"),
|
||||
cx, *vp)) {
|
||||
rv = NS_ERROR_DOM_NOT_OBJECT_ERR;
|
||||
}
|
||||
|
|
|
@ -373,7 +373,7 @@ SetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
if (NS_SUCCEEDED(rv)) {
|
||||
nsIDOMDocument* prop;
|
||||
if (PR_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&prop,
|
||||
kIDocumentIID, "Document",
|
||||
kIDocumentIID, NS_ConvertToString("Document"),
|
||||
cx, *vp)) {
|
||||
rv = NS_ERROR_DOM_NOT_OBJECT_ERR;
|
||||
}
|
||||
|
|
|
@ -592,7 +592,7 @@ HTMLImageElement(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
|
|||
return JS_FALSE;
|
||||
}
|
||||
|
||||
result = manager->LookupName("HTMLImageElement", PR_TRUE, classID);
|
||||
result = manager->LookupName(NS_ConvertToString("HTMLImageElement"), PR_TRUE, classID);
|
||||
if (NS_OK != result) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
|
|
@ -427,7 +427,7 @@ HTMLOptionElement(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
|
|||
return JS_FALSE;
|
||||
}
|
||||
|
||||
result = manager->LookupName("HTMLOptionElement", PR_TRUE, classID);
|
||||
result = manager->LookupName(NS_ConvertToString("HTMLOptionElement"), PR_TRUE, classID);
|
||||
if (NS_OK != result) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
|
|
@ -251,10 +251,10 @@ GetHTMLSelectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
|
||||
JSString *jsstring = JS_ValueToString(cx, id);
|
||||
if (nsnull != jsstring) {
|
||||
name.SetString(JS_GetStringChars(jsstring));
|
||||
name.Assign(JS_GetStringChars(jsstring));
|
||||
}
|
||||
else {
|
||||
name.SetString("");
|
||||
name.SetLength(0);
|
||||
}
|
||||
|
||||
if (NS_OK == a->QueryInterface(kINSHTMLSelectElementIID, (void **)&b)) {
|
||||
|
@ -508,14 +508,14 @@ HTMLSelectElementAdd(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
|
|||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b0),
|
||||
kIHTMLElementIID,
|
||||
"HTMLElement",
|
||||
NS_ConvertToString("HTMLElement"),
|
||||
cx,
|
||||
argv[0])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
}
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b1),
|
||||
kIHTMLElementIID,
|
||||
"HTMLElement",
|
||||
NS_ConvertToString("HTMLElement"),
|
||||
cx,
|
||||
argv[1])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
|
|
|
@ -302,7 +302,7 @@ SetHTMLTableElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
if (NS_SUCCEEDED(rv)) {
|
||||
nsIDOMHTMLTableCaptionElement* prop;
|
||||
if (PR_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&prop,
|
||||
kIHTMLTableCaptionElementIID, "HTMLTableCaptionElement",
|
||||
kIHTMLTableCaptionElementIID, NS_ConvertToString("HTMLTableCaptionElement"),
|
||||
cx, *vp)) {
|
||||
rv = NS_ERROR_DOM_NOT_OBJECT_ERR;
|
||||
}
|
||||
|
@ -318,7 +318,7 @@ SetHTMLTableElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
if (NS_SUCCEEDED(rv)) {
|
||||
nsIDOMHTMLTableSectionElement* prop;
|
||||
if (PR_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&prop,
|
||||
kIHTMLTableSectionElementIID, "HTMLTableSectionElement",
|
||||
kIHTMLTableSectionElementIID, NS_ConvertToString("HTMLTableSectionElement"),
|
||||
cx, *vp)) {
|
||||
rv = NS_ERROR_DOM_NOT_OBJECT_ERR;
|
||||
}
|
||||
|
@ -334,7 +334,7 @@ SetHTMLTableElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
if (NS_SUCCEEDED(rv)) {
|
||||
nsIDOMHTMLTableSectionElement* prop;
|
||||
if (PR_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&prop,
|
||||
kIHTMLTableSectionElementIID, "HTMLTableSectionElement",
|
||||
kIHTMLTableSectionElementIID, NS_ConvertToString("HTMLTableSectionElement"),
|
||||
cx, *vp)) {
|
||||
rv = NS_ERROR_DOM_NOT_OBJECT_ERR;
|
||||
}
|
||||
|
|
|
@ -252,7 +252,7 @@ SetHTMLTableRowElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
|
|||
if (NS_SUCCEEDED(rv)) {
|
||||
nsIDOMHTMLCollection* prop;
|
||||
if (PR_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&prop,
|
||||
kIHTMLCollectionIID, "HTMLCollection",
|
||||
kIHTMLCollectionIID, NS_ConvertToString("HTMLCollection"),
|
||||
cx, *vp)) {
|
||||
rv = NS_ERROR_DOM_NOT_OBJECT_ERR;
|
||||
}
|
||||
|
|
|
@ -117,10 +117,10 @@ GetNSHTMLOptionCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval
|
|||
|
||||
JSString *jsstring = JS_ValueToString(cx, id);
|
||||
if (nsnull != jsstring) {
|
||||
name.SetString(JS_GetStringChars(jsstring));
|
||||
name.Assign(JS_GetStringChars(jsstring));
|
||||
}
|
||||
else {
|
||||
name.SetString("");
|
||||
name.SetLength(0);
|
||||
}
|
||||
|
||||
result = a->NamedItem(name, &prop);
|
||||
|
|
|
@ -263,7 +263,7 @@ RangeSetStart(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
|
|||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b0),
|
||||
kINodeIID,
|
||||
"Node",
|
||||
NS_ConvertToString("Node"),
|
||||
cx,
|
||||
argv[0])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
|
@ -313,7 +313,7 @@ RangeSetStartBefore(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b0),
|
||||
kINodeIID,
|
||||
"Node",
|
||||
NS_ConvertToString("Node"),
|
||||
cx,
|
||||
argv[0])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
|
@ -360,7 +360,7 @@ RangeSetStartAfter(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b0),
|
||||
kINodeIID,
|
||||
"Node",
|
||||
NS_ConvertToString("Node"),
|
||||
cx,
|
||||
argv[0])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
|
@ -408,7 +408,7 @@ RangeSetEnd(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
|||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b0),
|
||||
kINodeIID,
|
||||
"Node",
|
||||
NS_ConvertToString("Node"),
|
||||
cx,
|
||||
argv[0])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
|
@ -458,7 +458,7 @@ RangeSetEndBefore(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
|
|||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b0),
|
||||
kINodeIID,
|
||||
"Node",
|
||||
NS_ConvertToString("Node"),
|
||||
cx,
|
||||
argv[0])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
|
@ -505,7 +505,7 @@ RangeSetEndAfter(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
|
|||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b0),
|
||||
kINodeIID,
|
||||
"Node",
|
||||
NS_ConvertToString("Node"),
|
||||
cx,
|
||||
argv[0])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
|
@ -595,7 +595,7 @@ RangeSelectNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
|
|||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b0),
|
||||
kINodeIID,
|
||||
"Node",
|
||||
NS_ConvertToString("Node"),
|
||||
cx,
|
||||
argv[0])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
|
@ -642,7 +642,7 @@ RangeSelectNodeContents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b0),
|
||||
kINodeIID,
|
||||
"Node",
|
||||
NS_ConvertToString("Node"),
|
||||
cx,
|
||||
argv[0])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
|
@ -694,7 +694,7 @@ RangeCompareEndPoints(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
}
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b1),
|
||||
kIRangeIID,
|
||||
"Range",
|
||||
NS_ConvertToString("Range"),
|
||||
cx,
|
||||
argv[1])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
|
@ -848,7 +848,7 @@ RangeInsertNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
|
|||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b0),
|
||||
kINodeIID,
|
||||
"Node",
|
||||
NS_ConvertToString("Node"),
|
||||
cx,
|
||||
argv[0])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
|
@ -895,7 +895,7 @@ RangeSurroundContents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b0),
|
||||
kINodeIID,
|
||||
"Node",
|
||||
NS_ConvertToString("Node"),
|
||||
cx,
|
||||
argv[0])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
|
|
|
@ -343,7 +343,7 @@ SelectionCollapse(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
|
|||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b0),
|
||||
kINodeIID,
|
||||
"Node",
|
||||
NS_ConvertToString("Node"),
|
||||
cx,
|
||||
argv[0])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
|
@ -394,7 +394,7 @@ SelectionExtend(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
|
|||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b0),
|
||||
kINodeIID,
|
||||
"Node",
|
||||
NS_ConvertToString("Node"),
|
||||
cx,
|
||||
argv[0])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
|
@ -516,7 +516,7 @@ SelectionContainsNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b0),
|
||||
kINodeIID,
|
||||
"Node",
|
||||
NS_ConvertToString("Node"),
|
||||
cx,
|
||||
argv[0])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
|
@ -601,7 +601,7 @@ SelectionAddRange(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
|
|||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b0),
|
||||
kIRangeIID,
|
||||
"Range",
|
||||
NS_ConvertToString("Range"),
|
||||
cx,
|
||||
argv[0])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
|
@ -648,7 +648,7 @@ SelectionRemoveRange(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
|
|||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b0),
|
||||
kIRangeIID,
|
||||
"Range",
|
||||
NS_ConvertToString("Range"),
|
||||
cx,
|
||||
argv[0])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
|
@ -765,7 +765,7 @@ SelectionAddSelectionListener(JSContext *cx, JSObject *obj, uintN argc, jsval *a
|
|||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b0),
|
||||
kISelectionListenerIID,
|
||||
"SelectionListener",
|
||||
NS_ConvertToString("SelectionListener"),
|
||||
cx,
|
||||
argv[0])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
|
@ -812,7 +812,7 @@ SelectionRemoveSelectionListener(JSContext *cx, JSObject *obj, uintN argc, jsval
|
|||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b0),
|
||||
kISelectionListenerIID,
|
||||
"SelectionListener",
|
||||
NS_ConvertToString("SelectionListener"),
|
||||
cx,
|
||||
argv[0])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
|
|
Загрузка…
Ссылка в новой задаче