Closed Bug 852742 Opened 11 years ago Closed 11 years ago

Remove bogus 'const' from nsViewManager::CreateView()'s "const nsView* aParent" parameter

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

Attachments

(1 file, 1 obsolete file)

nsViewManager::CreateView() takes a parameter "const nsView* aParent", which it proceeds to const_cast to a nsView*.  So the constness is a bit of a sham there.

Meanwhile, based on a quick sampling of its callers, it seems that it generally gets passed a "nsView*" -- so there doesn't seem to be any need for the parameter to be const.

Filing this bug on making that parameter just a normal "nsView*", assuming I'm not missing any trouble that that'd cause.

Marking dependency on Bug 848218, since this touches the same code that that patch touches, and I think the patch here should land after Bug 848218 so as not to bitrot it.
Attached patch fix (obsolete) — Splinter Review
This builds locally for me, so I think it's valid.
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #726967 - Flags: review?(bzbarsky)
and by Bug 848218 in comment 0, I of course meant bug 852428. (I copypasted the wrong bug number from the top of an attachment page on that bug.)
Depends on: 852428
No longer depends on: bmo_4_2_regressions
Here's the patch again, bitrot-fixed to layer on top of bug 852428's patches (since I don't intend to land this until after bug 852428 lands).
Attachment #726967 - Attachment is obsolete: true
Attachment #726967 - Flags: review?(bzbarsky)
Attachment #726970 - Flags: review?(bzbarsky)
Comment on attachment 726970 [details] [diff] [review]
fix (layered on top of bug 852428's patches)

r=me
Attachment #726970 - Flags: review?(bzbarsky) → review+
https://hg.mozilla.org/mozilla-central/rev/4dbe9d169f86
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: