Closed
Bug 232731
Opened 21 years ago
Closed 21 years ago
Minor cleanup in documentviewer/printing code
Categories
(Core :: Printing: Output, defect)
Core
Printing: Output
Tracking
()
RESOLVED
FIXED
People
(Reporter: keeda, Assigned: keeda)
Details
Attachments
(1 file, 1 obsolete file)
20.63 KB,
patch
|
Details | Diff | Splinter Review |
A few minor things accumulated in my tree while hunting some other bug. Ought to
be cleaned up...
- nsDocumentViewer::IsWebShellAFrameSet() is unused and can be removed.
- FindFrameSetWithIID() and GetPresShellAndRootContent() on the
nsIDocumentViewerPrint interface make no sense at all since they have
nothing to do with the DV. They can just be replaced by static helpers
in nsPrintEngine, which is the only thing that uses them.
- GetWebShellAndRootContent() only uses the document and doesnt even
touch its webshell param. And it can be static.
- GetPresShell() in nsPrintEngine is unused.
Patch coming up.
Assignee | ||
Comment 1•21 years ago
|
||
Assignee | ||
Comment 2•21 years ago
|
||
Comment on attachment 140299 [details] [diff] [review]
Fix
jst, r+sr ?
Attachment #140299 -
Flags: review?
Comment 3•21 years ago
|
||
Comment on attachment 140299 [details] [diff] [review]
Fix
- In nsPrintEngine::GetPresShellAndRootContent():
+ nsCOMPtr<nsIDOMDocument> domDoc(do_GetInterface(aDocShell));
+ if (!domDoc)
+ return;
+
+ nsCOMPtr<nsIDocument> doc(do_QueryInterface(domDoc));
+ if (!doc)
+ return;
You can loose the first null-check, do_QueryInterface() is null safe.
- In nsPrintEngine::HasFramesetChild():
+ nsCOMPtr<nsIDOMHTMLFrameSetElement> temp;
+ for (PRUint32 i = 0; i < numChildren; ++i) {
+ nsIContent *child = aContent->GetChildAt(i);
+ if (child) {
No need to check here, child won't be null.
+ temp = do_QueryInterface(child);
+ if (temp) {
+ return PR_TRUE;
I think this would be faster as:
+ if (child->Tag() == nsHTMLAtoms::frameset &&
+ child->IsContentOfType(nsIContent::eHTML)) {
+ return PR_TRUE;
r+sr=jst
Attachment #140299 -
Flags: superreview+
Attachment #140299 -
Flags: review?
Attachment #140299 -
Flags: review+
Assignee | ||
Comment 4•21 years ago
|
||
Thanks for the review. This patch addresses all those comments.
Assignee | ||
Updated•21 years ago
|
Attachment #140299 -
Attachment is obsolete: true
Assignee | ||
Comment 5•21 years ago
|
||
Checked in.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•