From aabe3e8b27e584ee3ada9c83087ec7c21470cac7 Mon Sep 17 00:00:00 2001 From: "morse%netscape.com" Date: Fri, 5 Feb 1999 22:05:59 +0000 Subject: [PATCH] removed single-signon dependency on lo_ele.h and MWContext --- include/proto.h | 6 ++---- layout/html/forms/src/nsFormFrame.cpp | 29 ++++++++++++--------------- network/module/nsINetService.h | 2 +- network/module/nsNetService.cpp | 4 ++-- network/module/nsNetService.h | 2 +- 5 files changed, 19 insertions(+), 24 deletions(-) diff --git a/include/proto.h b/include/proto.h index 0310815d8b46..adf0828a5b6f 100644 --- a/include/proto.h +++ b/include/proto.h @@ -268,11 +268,9 @@ extern Bool LO_GridCanGoBackward(MWContext *context); extern void SI_RestoreSignonData (char* URLName, char* name, char** value); extern void SI_RememberSignonData - (char* URLName, LO_FormSubmitData *submit); + (char* URLName, char** name_array, char** value_array, char** type_array, PRInt32 value_cnt); extern void SI_RememberSignonDataFromBrowser - (MWContext *context,char* URLName, char* username, char* password); -extern void SI_RestoreOldSignonData - (MWContext *context, LO_FormElementStruct *form_element, char *URLName); + (char* URLName, char* username, char* password); extern void SI_RestoreOldSignonDataFromBrowser (MWContext *context, char* URLName, Bool pickFirstUser, char** username, char** password); diff --git a/layout/html/forms/src/nsFormFrame.cpp b/layout/html/forms/src/nsFormFrame.cpp index 26f7c8b71b05..73c63d640f61 100644 --- a/layout/html/forms/src/nsFormFrame.cpp +++ b/layout/html/forms/src/nsFormFrame.cpp @@ -57,7 +57,8 @@ #include "prenv.h" #ifdef SingleSignon -#include "proto.h" +#define FORM_TYPE_TEXT 1 +#define FORM_TYPE_PASSWORD 7 #include "nsINetService.h" #include "nsIServiceManager.h" static NS_DEFINE_IID(kINetServiceIID, NS_INETSERVICE_IID); @@ -603,12 +604,7 @@ void nsFormFrame::ProcessAsURLEncoded(PRBool isPost, nsString& aData, nsIFormCon char* name_array[MAX_ARRAY_SIZE]; char* value_array[MAX_ARRAY_SIZE]; uint8 type_array[MAX_ARRAY_SIZE]; - LO_FormSubmitData submit; - - submit.value_cnt = 0; - submit.type_array = (PA_Block)type_array; - submit.name_array = (PA_Block)name_array; - submit.value_array = (PA_Block)value_array; + PRInt32 value_cnt = 0; /* get url name as ascii string */ char *URLName; @@ -643,15 +639,15 @@ void nsFormFrame::ProcessAsURLEncoded(PRBool isPost, nsString& aData, nsIFormCon child->GetType(&type); if ((type == NS_FORM_INPUT_PASSWORD) || (type == NS_FORM_INPUT_TEXT)) { if (type == NS_FORM_INPUT_PASSWORD) { - type_array[submit.value_cnt] = FORM_TYPE_PASSWORD; + type_array[value_cnt] = FORM_TYPE_PASSWORD; } else { - type_array[submit.value_cnt] = FORM_TYPE_TEXT; + type_array[value_cnt] = FORM_TYPE_TEXT; } - value_array[submit.value_cnt] = + value_array[value_cnt] = values[0].ToNewCString(); - name_array[submit.value_cnt] = + name_array[value_cnt] = names[0].ToNewCString(); - submit.value_cnt++; + value_cnt++; } #endif for (int valueX = 0; valueX < numValues; valueX++) { @@ -680,13 +676,14 @@ void nsFormFrame::ProcessAsURLEncoded(PRBool isPost, nsString& aData, nsIFormCon kINetServiceIID, (nsISupports **)&service); if ((NS_OK == res) && (nsnull != service)) { - res = service->SI_RememberSignonData(URLName, &submit); + res = service->SI_RememberSignonData + (URLName, (char**)name_array, (char**)value_array, (char**)type_array, value_cnt); NS_RELEASE(service); } PR_FREEIF(URLName); - while (submit.value_cnt--) { - PR_FREEIF(name_array[submit.value_cnt]); - PR_FREEIF(value_array[submit.value_cnt]); + while (value_cnt--) { + PR_FREEIF(name_array[value_cnt]); + PR_FREEIF(value_array[value_cnt]); } #endif diff --git a/network/module/nsINetService.h b/network/module/nsINetService.h index 116b98087ebc..180ba99f2c30 100644 --- a/network/module/nsINetService.h +++ b/network/module/nsINetService.h @@ -109,7 +109,7 @@ struct nsINetService : public nsISupports #ifdef SingleSignon NS_IMETHOD SI_DisplaySignonInfoAsHTML()=0; NS_IMETHOD SI_RememberSignonData - (char* URLName, LO_FormSubmitData *submit)=0; + (char* URLName, char** name_array, char** value_array, char** type_array, PRInt32 value_cnt)=0; NS_IMETHOD SI_RestoreSignonData (char* URLNAME, char* name, char** value)=0; #endif diff --git a/network/module/nsNetService.cpp b/network/module/nsNetService.cpp index a21ece5d8629..0d4b63aa0583 100644 --- a/network/module/nsNetService.cpp +++ b/network/module/nsNetService.cpp @@ -694,8 +694,8 @@ nsNetlibService::SI_DisplaySignonInfoAsHTML(){ NS_IMETHODIMP nsNetlibService::SI_RememberSignonData - (char* URLName, LO_FormSubmitData *submit) { - ::SI_RememberSignonData(URLName, submit); + (char* URLName, char** name_array, char** value_array, char** type_array, PRInt32 value_cnt) { + ::SI_RememberSignonData(URLName, name_array, value_array, type_array, value_cnt); return NS_OK; } diff --git a/network/module/nsNetService.h b/network/module/nsNetService.h index b877f0af3962..042448516c7a 100644 --- a/network/module/nsNetService.h +++ b/network/module/nsNetService.h @@ -53,7 +53,7 @@ public: #ifdef SingleSignon NS_IMETHOD SI_DisplaySignonInfoAsHTML(); NS_IMETHOD SI_RememberSignonData - (char* URLName, LO_FormSubmitData *submit); + (char* URLName, char** name_array, char** value_array, char** type_array, PRInt32 value_cnt); NS_IMETHOD SI_RestoreSignonData (char* URLNAME, char* name, char** value); #endif