Closed Bug 1552880 Opened 6 years ago Closed 6 years ago

Start clearing up some of nsPrintJob's non-obvious distinction between original, source and preview documents

Categories

(Core :: Printing: Setup, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla69
Tracking Status
firefox69 --- fixed

People

(Reporter: jwatt, Assigned: jwatt)

Details

Attachments

(2 files)

It's not obvious, since the code doesn't hint at it in naming or detail it in comments, but nsPrintJob essentially acts on three different documents: an original document (never changes), a source document (may change over time) and one or more print preview document (may change over time).

(Further adding to the confusion, the "original" document is not necessarily the original document that the user selected to print since Firefox frontend code sometimes passes an existing print preview document as the "original", but lets leave that for another bug. Baby steps...)

Unsurprisingly, this has over the years ended up resulting in code using the wrong things and generally being an impenetrable mess. In this bug I'll do some renaming, restructuring and commenting. I'll then have one or more separate bugs for changes that actually make behavior changes (hopefully fixing bugs, but with some risk of introducing bugs too given the mess this code is in).

This stops nsPrintJob::PrintPreview from duplicating work done in
nsDocumentViewer::PrintPreview.

Pushed by jwatt@jwatt.org: https://hg.mozilla.org/integration/mozilla-inbound/rev/6030ebc07cd2 p1. Pass a document to nsPrintJob::PrintPreview instead of a window. r=bobowen https://hg.mozilla.org/integration/mozilla-inbound/rev/a42daaa44f88 p2. Document nsPritJob's Initialize, Print and PrintPreview and rename their document params. r=bobowen
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: