Bug 179798 cookie confirm dialog no longer works in embedding (doesn't call nsIPrompt service)

patch by mvl@exedo.nl r=dwitte sr=darin
This commit is contained in:
timeless@mozdev.org
2003-01-22 05:52:33 +00:00
parent b5907325b5
commit 37175c7583
28 changed files with 607 additions and 270 deletions

View File

@@ -338,7 +338,9 @@ nsPromptService::ConfirmEx(nsIDOMWindow *parent,
if (checkMsg && checkValue) {
block->SetString(eCheckboxMsg, checkMsg);
block->SetInt(eCheckboxState, *checkValue);
// since we're setting a PRInt32, we have to sanitize the PRBool first.
// (myBool != PR_FALSE) is guaranteed to return either 1 or 0.
block->SetInt(eCheckboxState, *checkValue != PR_FALSE);
}
/* perform the dialog */
@@ -352,8 +354,12 @@ nsPromptService::ConfirmEx(nsIDOMWindow *parent,
if (buttonPressed)
block->GetInt(eButtonPressed, buttonPressed);
if (checkMsg && checkValue)
block->GetInt(eCheckboxState, checkValue);
if (checkMsg && checkValue) {
// GetInt returns a PRInt32; we need to sanitize it into PRBool
PRInt32 tempValue;
block->GetInt(eCheckboxState, &tempValue);
*checkValue = (tempValue == 1);
}
return rv;
}