Closed Bug 414046 Opened 17 years ago Closed 16 years ago

nsPresShell::GetLayoutObjectFor() should be removed

Categories

(Core :: Layout, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED

People

(Reporter: aaronlev, Assigned: Swatinem)

Details

Attachments

(1 file, 2 obsolete files)

There is no need for it -- it's redundant with GetPrimaryFrameFor(), and GetPrimaryFrameFor() is more convenient since it returns the frame (instead of using an out param).
OS: AIX → All
Attached patch patch (obsolete) — Splinter Review
I pushed the QI logic to the only 2 callers, I'm not sure it's still needed though.
Assignee: nobody → arpad.borsos
Status: NEW → ASSIGNED
Attachment #335504 - Flags: superreview?(roc)
Attachment #335504 - Flags: review?(roc)
It's not needed, just return the frame directly. Maybe add an NS_ASSERTION that the QI returns the same pointer value as the frame.

And rev the IID on nsIPresShell.
Attached patch v2 (obsolete) — Splinter Review
I hope this is right. At least the compiler doesn't complain about it. :D
Hm the only 2 users of the http://mxr.mozilla.org/mozilla-central/ident?i=GetLayoutObject methods I found were in http://mxr.mozilla.org/mozilla-central/source/editor/libeditor/html/nsTableEditor.cpp#2722
Maybe it would be an idea to push the code even further up the call chain?
Attachment #335504 - Attachment is obsolete: true
Attachment #335512 - Flags: superreview?(roc)
Attachment #335512 - Flags: review?(roc)
Attachment #335504 - Flags: superreview?(roc)
Attachment #335504 - Flags: review?(roc)
Attached patch v3Splinter Review
This patch gets rid of both GetLayoutObject methods and moves the code up to nsHTMLEditor::GetCellIndexes and nsHTMLEditor::GetTableLayoutObject which are defined in nsTableEditor.cpp.
I left the QI parts in as they cast the frame to nsITableCellLayout or nsITableLayout respectively.
Attachment #335512 - Attachment is obsolete: true
Attachment #335628 - Flags: superreview?(roc)
Attachment #335628 - Flags: review?(roc)
Attachment #335512 - Flags: superreview?(roc)
Attachment #335512 - Flags: review?(roc)
Attachment #335628 - Flags: superreview?(roc)
Attachment #335628 - Flags: superreview+
Attachment #335628 - Flags: review?(roc)
Attachment #335628 - Flags: review+
Keywords: checkin-needed
Pushed to mozilla-central, changeset 5abe5d840c95.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: