From 8d634e346513cd75730e9e72655bafdec754fcc6 Mon Sep 17 00:00:00 2001 From: "javi%netscape.com" Date: Thu, 21 Sep 2000 01:51:15 +0000 Subject: [PATCH] bug #51568 r=thayes,ddrinan a=brendan Modify the inputs to open PSM windows so that SDR password windows work properly. git-svn-id: svn://10.0.0.236/trunk@79690 18797224-902f-48f8-a5cc-f745e15eee43 --- .../psm-glue/src/nsPSMUICallbacks.cpp | 54 +++++++++---------- 1 file changed, 24 insertions(+), 30 deletions(-) diff --git a/mozilla/extensions/psm-glue/src/nsPSMUICallbacks.cpp b/mozilla/extensions/psm-glue/src/nsPSMUICallbacks.cpp index 723c031505a..820b676c4dd 100644 --- a/mozilla/extensions/psm-glue/src/nsPSMUICallbacks.cpp +++ b/mozilla/extensions/psm-glue/src/nsPSMUICallbacks.cpp @@ -100,37 +100,31 @@ nsPSMUIHandlerImpl::DisplayURI(PRInt32 width, PRInt32 height, PRBool modal, cons } } - // Set up arguments for "window.open" - void *stackPtr; - char params[36]; - - if (modal) { // if you change this, remember to change the buffer size above. - strcpy(params, "menubar=no,height=%d,width=%d,dependent"); + // Set up arguments for "window.open" + // Do not modify the string after the "modal ?" statement + // without first consulting the PSM team. Either ddrinan or javi + char buffer[256]; + PR_snprintf(buffer, + sizeof(buffer), + modal ? "menubar=no,height=%d,width=%d,dependent,modal" + : "menubar=no,height=%d,width=%d", + height, + width ); + void *stackPtr; + argv = JS_PushArguments(jsContext, &stackPtr, "sss", urlStr, "_blank", buffer); + if (argv) { + // open the window + nsIDOMWindowInternal *newWindow; + if (modal && win) { + parentWindow->OpenDialog(jsContext, argv, 3, &newWindow); } else { - strcpy(params, "menubar=no,height=%d,width=%d"); - } - - char buffer[256]; - PR_snprintf(buffer, - sizeof(buffer), - params, - height, - width ); - - argv = JS_PushArguments(jsContext, &stackPtr, "sss", urlStr, "_blank", buffer); - if (argv) { - // open the window - nsIDOMWindowInternal *newWindow; - if (modal && win) { - parentWindow->OpenDialog(jsContext, argv, 3, &newWindow); - } else { - parentWindow->Open(jsContext, argv, 3, &newWindow); - } - newWindow->ResizeTo(width, height); - JS_PopArguments(jsContext, stackPtr); - } -loser: - return rv; + parentWindow->Open(jsContext, argv, 3, &newWindow); + } + newWindow->ResizeTo(width, height); + JS_PopArguments(jsContext, stackPtr); + } + loser: + return rv; } NS_IMETHODIMP