Closed Bug 167762 Opened 24 years ago Closed 23 years ago

Make nsIFormControl::GetType() return int instead of nsresult

Categories

(Core :: Layout: Form Controls, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: john, Assigned: john)

Details

Attachments

(1 file, 1 obsolete file)

nsIFormControl::GetType() requires an out parameter instead of returning an int. It *always* returns a value and *never* returns any nsresult other than NS_OK. It should be changed to NS_IMETHOD_(PRInt32). Not only would it make callers simpler, it would make things less confusing--"do I have to check the return value or not?"
Status: NEW → ASSIGNED
Attached patch Patch (obsolete) — Splinter Review
This also makes nsIFormControlFrame::GetType() do the same thing.
Attachment #109640 - Flags: review?(peterl)
Comment on attachment 109640 [details] [diff] [review] Patch Looks good, r=peterl, but did these two sections accidentally slip in? >Index: layout/html/style/src/nsCSSFrameConstructor.cpp >=================================================================== >@@ -4934,7 +4932,6 @@ > if (!aState.mPseudoFrames.IsEmpty()) { // process pending pseudo frames > ProcessPseudoFrames(aPresContext, aState.mPseudoFrames, aFrameItems); > } >- isReplaced = PR_TRUE; > > PRBool allowSubframes = PR_TRUE; > if (aPresContext) { >@@ -7327,6 +7324,9 @@ > { >+ if (aTag == nsHTMLAtoms::noframes) { >+ printf("noframes\n"); >+ } > // The following code allows the user to specify the base tag > // of an element using XBL. XUL and HTML objects (like boxes, menus, etc.) > // can then be extended arbitrarily.
Attachment #109640 - Flags: review?(peterl) → review+
Attached patch Patch v1.1Splinter Review
Excellent catch!
Attachment #109640 - Attachment is obsolete: true
Comment on attachment 109686 [details] [diff] [review] Patch v1.1 Peter has already reviewed this.
Attachment #109686 - Flags: superreview?(kin)
Comment on attachment 109686 [details] [diff] [review] Patch v1.1 >+ * @return the type to be returned [OUT] You want to remove the [OUT] no? And maybe clarify that a tad? "Return the type to be returned" sounds a bit flaky. What about: @return the type of the form control.
Comment on attachment 109686 [details] [diff] [review] Patch v1.1 sr=kin@netscape.com Just address caillon's issue and check if the following change needs the type to mType treatment: @@ -2022,8 +1996,7 @@
Attachment #109686 - Flags: superreview?(kin) → superreview+
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: