Warning cleanups.
This commit is contained in:
Родитель
9b7cbfb55a
Коммит
9e3f0fe780
|
@ -294,16 +294,16 @@ nsHTMLFormElement::Submit()
|
||||||
{
|
{
|
||||||
// XXX Need to do something special with mailto: or news: URLs
|
// XXX Need to do something special with mailto: or news: URLs
|
||||||
nsIDocument* doc = nsnull;
|
nsIDocument* doc = nsnull;
|
||||||
nsresult result = GetDocument(doc);
|
nsresult res = GetDocument(doc);
|
||||||
if ((NS_OK == result) && doc) {
|
if ((NS_OK == res) && doc) {
|
||||||
nsIPresShell *shell = doc->GetShellAt(0);
|
nsIPresShell *shell = doc->GetShellAt(0);
|
||||||
if (nsnull != shell) {
|
if (nsnull != shell) {
|
||||||
nsIFrame* frame;
|
nsIFrame* frame;
|
||||||
shell->GetPrimaryFrameFor(this, &frame);
|
shell->GetPrimaryFrameFor(this, &frame);
|
||||||
if (frame) {
|
if (frame) {
|
||||||
nsIFormManager* formMan = nsnull;
|
nsIFormManager* formMan = nsnull;
|
||||||
nsresult result = frame->QueryInterface(kIFormManagerIID, (void**)&formMan);
|
res = frame->QueryInterface(kIFormManagerIID, (void**)&formMan);
|
||||||
if ((NS_OK == result) && formMan) {
|
if ((NS_OK == res) && formMan) {
|
||||||
nsCOMPtr<nsIPresContext> context;
|
nsCOMPtr<nsIPresContext> context;
|
||||||
shell->GetPresContext(getter_AddRefs(context));
|
shell->GetPresContext(getter_AddRefs(context));
|
||||||
if (context) {
|
if (context) {
|
||||||
|
@ -311,7 +311,7 @@ nsHTMLFormElement::Submit()
|
||||||
// It works for now, but might not always
|
// It works for now, but might not always
|
||||||
// be correct. In the future, we might not need the
|
// be correct. In the future, we might not need the
|
||||||
// frame to be passed to the link handler.
|
// frame to be passed to the link handler.
|
||||||
result = formMan->OnSubmit(context, nsnull);
|
res = formMan->OnSubmit(context, nsnull);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -320,7 +320,7 @@ nsHTMLFormElement::Submit()
|
||||||
NS_RELEASE(doc);
|
NS_RELEASE(doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
|
@ -328,24 +328,24 @@ nsHTMLFormElement::Reset()
|
||||||
{
|
{
|
||||||
// XXX Need to do something special with mailto: or news: URLs
|
// XXX Need to do something special with mailto: or news: URLs
|
||||||
nsIDocument* doc = nsnull;
|
nsIDocument* doc = nsnull;
|
||||||
nsresult result = GetDocument(doc);
|
nsresult res = GetDocument(doc);
|
||||||
if ((NS_OK == result) && doc) {
|
if ((NS_OK == res) && doc) {
|
||||||
nsIPresShell *shell = doc->GetShellAt(0);
|
nsIPresShell *shell = doc->GetShellAt(0);
|
||||||
if (nsnull != shell) {
|
if (nsnull != shell) {
|
||||||
nsIFrame* frame;
|
nsIFrame* frame;
|
||||||
shell->GetPrimaryFrameFor(this, &frame);
|
shell->GetPrimaryFrameFor(this, &frame);
|
||||||
if (frame) {
|
if (frame) {
|
||||||
nsIFormManager* formMan = nsnull;
|
nsIFormManager* formMan = nsnull;
|
||||||
nsresult result = frame->QueryInterface(kIFormManagerIID, (void**)&formMan);
|
res = frame->QueryInterface(kIFormManagerIID, (void**)&formMan);
|
||||||
if ((NS_OK == result) && formMan) {
|
if ((NS_OK == res) && formMan) {
|
||||||
result = formMan->OnReset();
|
res = formMan->OnReset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
NS_RELEASE(shell);
|
NS_RELEASE(shell);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return res;
|
||||||
}
|
}
|
||||||
static nsGenericHTMLElement::EnumTable kFormMethodTable[] = {
|
static nsGenericHTMLElement::EnumTable kFormMethodTable[] = {
|
||||||
{ "get", NS_FORM_METHOD_GET },
|
{ "get", NS_FORM_METHOD_GET },
|
||||||
|
@ -656,9 +656,7 @@ nsresult nsFormControlList::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||||
if (NULL == aInstancePtr) {
|
if (NULL == aInstancePtr) {
|
||||||
return NS_ERROR_NULL_POINTER;
|
return NS_ERROR_NULL_POINTER;
|
||||||
}
|
}
|
||||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
|
||||||
static NS_DEFINE_IID(kIDOMHTMLCollectionIID, NS_IDOMHTMLCOLLECTION_IID);
|
static NS_DEFINE_IID(kIDOMHTMLCollectionIID, NS_IDOMHTMLCOLLECTION_IID);
|
||||||
static NS_DEFINE_IID(kIScriptObjectOwnerIID, NS_ISCRIPTOBJECTOWNER_IID);
|
|
||||||
if (aIID.Equals(kIDOMHTMLCollectionIID)) {
|
if (aIID.Equals(kIDOMHTMLCollectionIID)) {
|
||||||
*aInstancePtr = (void*)(nsIDOMHTMLCollection*)this;
|
*aInstancePtr = (void*)(nsIDOMHTMLCollection*)this;
|
||||||
AddRef();
|
AddRef();
|
||||||
|
|
|
@ -294,16 +294,16 @@ nsHTMLFormElement::Submit()
|
||||||
{
|
{
|
||||||
// XXX Need to do something special with mailto: or news: URLs
|
// XXX Need to do something special with mailto: or news: URLs
|
||||||
nsIDocument* doc = nsnull;
|
nsIDocument* doc = nsnull;
|
||||||
nsresult result = GetDocument(doc);
|
nsresult res = GetDocument(doc);
|
||||||
if ((NS_OK == result) && doc) {
|
if ((NS_OK == res) && doc) {
|
||||||
nsIPresShell *shell = doc->GetShellAt(0);
|
nsIPresShell *shell = doc->GetShellAt(0);
|
||||||
if (nsnull != shell) {
|
if (nsnull != shell) {
|
||||||
nsIFrame* frame;
|
nsIFrame* frame;
|
||||||
shell->GetPrimaryFrameFor(this, &frame);
|
shell->GetPrimaryFrameFor(this, &frame);
|
||||||
if (frame) {
|
if (frame) {
|
||||||
nsIFormManager* formMan = nsnull;
|
nsIFormManager* formMan = nsnull;
|
||||||
nsresult result = frame->QueryInterface(kIFormManagerIID, (void**)&formMan);
|
res = frame->QueryInterface(kIFormManagerIID, (void**)&formMan);
|
||||||
if ((NS_OK == result) && formMan) {
|
if ((NS_OK == res) && formMan) {
|
||||||
nsCOMPtr<nsIPresContext> context;
|
nsCOMPtr<nsIPresContext> context;
|
||||||
shell->GetPresContext(getter_AddRefs(context));
|
shell->GetPresContext(getter_AddRefs(context));
|
||||||
if (context) {
|
if (context) {
|
||||||
|
@ -311,7 +311,7 @@ nsHTMLFormElement::Submit()
|
||||||
// It works for now, but might not always
|
// It works for now, but might not always
|
||||||
// be correct. In the future, we might not need the
|
// be correct. In the future, we might not need the
|
||||||
// frame to be passed to the link handler.
|
// frame to be passed to the link handler.
|
||||||
result = formMan->OnSubmit(context, nsnull);
|
res = formMan->OnSubmit(context, nsnull);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -320,7 +320,7 @@ nsHTMLFormElement::Submit()
|
||||||
NS_RELEASE(doc);
|
NS_RELEASE(doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
|
@ -328,24 +328,24 @@ nsHTMLFormElement::Reset()
|
||||||
{
|
{
|
||||||
// XXX Need to do something special with mailto: or news: URLs
|
// XXX Need to do something special with mailto: or news: URLs
|
||||||
nsIDocument* doc = nsnull;
|
nsIDocument* doc = nsnull;
|
||||||
nsresult result = GetDocument(doc);
|
nsresult res = GetDocument(doc);
|
||||||
if ((NS_OK == result) && doc) {
|
if ((NS_OK == res) && doc) {
|
||||||
nsIPresShell *shell = doc->GetShellAt(0);
|
nsIPresShell *shell = doc->GetShellAt(0);
|
||||||
if (nsnull != shell) {
|
if (nsnull != shell) {
|
||||||
nsIFrame* frame;
|
nsIFrame* frame;
|
||||||
shell->GetPrimaryFrameFor(this, &frame);
|
shell->GetPrimaryFrameFor(this, &frame);
|
||||||
if (frame) {
|
if (frame) {
|
||||||
nsIFormManager* formMan = nsnull;
|
nsIFormManager* formMan = nsnull;
|
||||||
nsresult result = frame->QueryInterface(kIFormManagerIID, (void**)&formMan);
|
res = frame->QueryInterface(kIFormManagerIID, (void**)&formMan);
|
||||||
if ((NS_OK == result) && formMan) {
|
if ((NS_OK == res) && formMan) {
|
||||||
result = formMan->OnReset();
|
res = formMan->OnReset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
NS_RELEASE(shell);
|
NS_RELEASE(shell);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return res;
|
||||||
}
|
}
|
||||||
static nsGenericHTMLElement::EnumTable kFormMethodTable[] = {
|
static nsGenericHTMLElement::EnumTable kFormMethodTable[] = {
|
||||||
{ "get", NS_FORM_METHOD_GET },
|
{ "get", NS_FORM_METHOD_GET },
|
||||||
|
@ -656,9 +656,7 @@ nsresult nsFormControlList::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||||
if (NULL == aInstancePtr) {
|
if (NULL == aInstancePtr) {
|
||||||
return NS_ERROR_NULL_POINTER;
|
return NS_ERROR_NULL_POINTER;
|
||||||
}
|
}
|
||||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
|
||||||
static NS_DEFINE_IID(kIDOMHTMLCollectionIID, NS_IDOMHTMLCOLLECTION_IID);
|
static NS_DEFINE_IID(kIDOMHTMLCollectionIID, NS_IDOMHTMLCOLLECTION_IID);
|
||||||
static NS_DEFINE_IID(kIScriptObjectOwnerIID, NS_ISCRIPTOBJECTOWNER_IID);
|
|
||||||
if (aIID.Equals(kIDOMHTMLCollectionIID)) {
|
if (aIID.Equals(kIDOMHTMLCollectionIID)) {
|
||||||
*aInstancePtr = (void*)(nsIDOMHTMLCollection*)this;
|
*aInstancePtr = (void*)(nsIDOMHTMLCollection*)this;
|
||||||
AddRef();
|
AddRef();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче