Open Bug 1669385 Opened 4 years ago Updated 1 year ago

Replace nsIPrintSettings.paperWidth/paperHeight/paperSizeUnit with a single setter

Categories

(Core :: Printing: Setup, enhancement, P2)

enhancement

Tracking

()

People

(Reporter: jwatt, Unassigned)

Details

(Whiteboard: [print2020])

I think we should replace the nsIPrintSettings.paperWidth/paperHeight/paperSizeUnit setters with a single setter to eliminate the possibility of anyone writing code that sets the width/height but forgets to set the unit. I'm suspicious that this may have happened for a period of time and caused some of the print settings pref "corruption" we've seen in the last few months. Even if that wasn't the case, it would be prudent to make this API more robust given the potential printing breakage that can occur.

(Since I don't think we have any reason to want to set nsIPrintSettings.paperWidth/paperHeight individually, I don't see any disadvangate to a single method.)

While we're at it, we should validate the values passed (the unit particularly, but also against non-negative value) and throw for invalid values. This is taking things further than the checks introduced in bug 1669370 and making them more agressive/robust.

Whiteboard: [print2020_v83] → [print2020_v85]
Whiteboard: [print2020_v85] → [print2020_v88]
Whiteboard: [print2020_v88] → [print2020]
You need to log in before you can comment on or make changes to this bug.