Closed Bug 1681344 Opened 4 years ago Closed 4 years ago

Eliminate the storage of a PMPageFormat in prefs

Categories

(Core :: Printing: Setup, task)

Unspecified
macOS
task

Tracking

()

RESOLVED FIXED
86 Branch
Tracking Status
firefox86 --- fixed

People

(Reporter: jfkthame, Assigned: jfkthame)

References

Details

Attachments

(1 file, 1 obsolete file)

We currently have code to serialize a PMPageFormat object from the macOS print settings and store it in a pref, and to read it back again. But this shouldn't be needed, as this object just serves to store "information such as the paper size, orientation, and scale of pages"[1], which we have in our base print settings object anyhow.

We don't make any use of the "extended data" functions to attach extra stuff to the PMPageFormat. So it appears to be redundant; we can just set up the page format parameters from our base-class members as needed.

[1] https://developer.apple.com/documentation/applicationservices/pmpageformat?language=objc

Type: enhancement → task
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED

We'll need to fix this in order for bug 1669905's patches to work correctly. See dupe bug 1682403 for more on that.

(Right now with my WIP code for bug 1669905, when we print two side-by-side portrait-oriented pages on a landscape-oriented sheet, we inadvertently end up serializing the landscape page-orientation into the PMPageFormat and using landscape as the default orientation for the next print operation. This isn't a problem once we've removed the PMPageFormat stuff via the patch here.)

Blocks: 1669905
Attachment #9194500 - Attachment description: Bug 1681344 part 1: Add nsIPrintSettings APIs to handle the possibility that pages and sheets may have orthogonal orientation, in pages-per-sheet printouts. → Bug 1681344 part 2: Add nsIPrintSettings APIs to handle the possibility that pages and sheets may have orthogonal orientation, in pages-per-sheet printouts.

Sorry for bug/patch-spam -- that was a bug number mis-paste on my part.

jfkthame: when you get around to it, it looks like the patch needs a manual rebase to account for some changes to the code that this patch is removing, in nsPrintSettingsServiceX.mm.

(Probably trivial, and no rush at all, particularly during the holiday. Just pinging as a heads-up -- I happened to notice the rebase failure locally, because I'm building with this patch locally.)

Flags: needinfo?(jfkthame)
Flags: needinfo?(jfkthame)

(In reply to Daniel Holbert [:dholbert] from comment #4)

We'll need to fix this in order for bug 1669905's patches to work correctly.

(This is now the only thing blocking that bug's last patch from landing, for 2&6 pages-per-sheet -- setting ni=jwatt to be sure this is still on his radar for review.)

Flags: needinfo?(jwatt)

There is a report in this reddit thread where a 10KB print.macosx.pagesetup-2 pref was apparently impacting print dialog opening performance.

Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d5525991f7c7
Eliminate reading/writing of a PMPageFormat to prefs on macOS. r=jwatt
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch
Flags: needinfo?(jwatt)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: