Closed Bug 1735587 Opened 3 years ago Closed 3 years ago

"Sheets of paper" incorrect when numCopies>1 and sheetCount is odd

Categories

(Toolkit :: Printing, defect, P1)

Desktop
All
defect

Tracking

()

VERIFIED FIXED
95 Branch
Tracking Status
firefox-esr91 --- verified
firefox94 --- verified
firefox95 --- verified

People

(Reporter: haik, Assigned: haik)

References

Details

Attachments

(1 file)

There's a bug in the fix for bug 1695645 that occurs when numCopies > 1 and the number of pages is odd.

For a 3 page document, printing double sided will require 2 sheets of paper. If numCopies==2, then a total of 4 sheets is needed. However the calculation incorrectly ends up with 3. The numCopies multiplier should be done after the duplex check. I'll file a new bug. It will be a simple fix.

Existing code:

+    let sheetCount = this.sheetCount * this.numCopies;
+
+    // When printing to a printer (not to a file) update
+    // the sheet count to account for duplex printing.
+    if (!this.printToFile && this.duplex != Ci.nsIPrintSettings.kDuplexNone) {
+      sheetCount = Math.ceil(sheetCount / 2);
+    }
Assignee: nobody → haftandilian
Severity: -- → S3
Priority: -- → P1

Multiply the sheet count by numCopies after accounting for duplex printing.

Pushed by haftandilian@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6b1fd065c98c
"Sheets of paper" incorrect when numCopies>1 and sheetCount is odd r=emilio
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 95 Branch

Comment on attachment 9245844 [details]
Bug 1735587 - "Sheets of paper" incorrect when numCopies>1 and sheetCount is odd r?emilio

Beta/Release Uplift Approval Request

  • User impact if declined: When printing multiple copies of a document with an odd number of pages in double-sided mode (aka duplex mode) , the "<x> sheets of paper" text in the print dialog will display the wrong number of pages.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: Open the print dialog for a document with an odd number of pages and set the options to print more than one copy and in double-sided mode. The sheet count should reflect double-side count with each copy not sharing any pages.
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Only affects the print dialog and is a very small change.
  • String changes made/needed:
Attachment #9245844 - Flags: approval-mozilla-beta?

Comment on attachment 9245844 [details]
Bug 1735587 - "Sheets of paper" incorrect when numCopies>1 and sheetCount is odd r?emilio

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: Same rationale as bug 1695645 which introduced this problem. It's a "paper cut" type issue (no pun intended) for printing causing the "<number> of sheets of paper" label to be incorrect when double-sided printing is used for a document with an odd number of pages with multiple copies enabled. Likely to be more annoying in ESR where presumably more printing is done.
  • User impact if declined: When printing multiple copies of a document with an odd number of pages in double-sided mode (aka duplex mode) , the "<x> sheets of paper" text in the print dialog will display the wrong number of pages.
  • Fix Landed on Version: 95
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Only affects the print dialog and is a very small change.
  • String or UUID changes made by this patch:
Attachment #9245844 - Flags: approval-mozilla-esr91?

Comment on attachment 9245844 [details]
Bug 1735587 - "Sheets of paper" incorrect when numCopies>1 and sheetCount is odd r?emilio

Follow-up fix for bug 1695645, approved for 94.0b9 and 91.3esr.

Attachment #9245844 - Flags: approval-mozilla-esr91?
Attachment #9245844 - Flags: approval-mozilla-esr91+
Attachment #9245844 - Flags: approval-mozilla-beta?
Attachment #9245844 - Flags: approval-mozilla-beta+
Flags: qe-verify+
QA Whiteboard: [qa-triaged]

I was able to reproduce the issue on Firefox 95.0a1 (2021-10-13) under Windows 11 by following the information provided on Comment 4.

The issue is fixed on Firefox 95.0a1 (2021-10-24), Firefox 94.0b9 and ESR 91.3.0 (build from treeherder - 20211024155628). Tests were performed on Windows 11, macOS 11.6.7 and Ubuntu 20.04.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: