Bug 78805 - [GTK] Allow printing multiple copies in WebKit2 for printers that don't support it
: [GTK] Allow printing multiple copies in WebKit2 for printers that don't suppo...
Status: RESOLVED FIXED
Product: WebKit
Classification: Unclassified
Component: WebKit2
: 528+ (Nightly build)
: PC Linux
: P2 Normal
Assigned To: Nobody
: Gtk
Depends on: 78799
Blocks: 75544 78823
  Show dependency treegraph
 
Reported: 2012-02-16 05:57 PST by Carlos Garcia Campos
Modified: 2012-02-17 10:08 PST (History)
1 user (show)

See Also:


Attachments
Patch (6.74 KB, patch)
2012-02-16 06:02 PST, Carlos Garcia Campos
gns: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2012-02-16 05:57:37 PST
This is another print capability that needs to be implemented manually for printers that doesn't support it like Print To File
Comment 1 Carlos Garcia Campos 2012-02-16 06:02:59 PST
Created attachment 127367 [details]
Patch

It supports collated and uncollated copies.
Comment 2 Gustavo Noronha (kov) 2012-02-16 16:40:29 PST
Comment on attachment 127367 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=127367&action=review

> Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:329
> +                collated = 0;

This puzzled me. Why do you set collated to 0 in this case? Is it so that if there are uncollated copies left the count will start from scratch?
Comment 3 Carlos Garcia Campos 2012-02-17 09:51:29 PST
(In reply to comment #2)
> (From update of attachment 127367 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=127367&action=review
> 
> > Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:329
> > +                collated = 0;
> 
> This puzzled me. Why do you set collated to 0 in this case? Is it so that if there are uncollated copies left the count will start from scratch?

No, there can't be collated and uncollated at the same time, they are mutually exclusive. When collatedCopiesLeft() is 0, it's because collated == collatedCopies - 1, so we reset it to 0, so that next page is collated again.
Comment 4 Gustavo Noronha (kov) 2012-02-17 09:53:58 PST
Comment on attachment 127367 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=127367&action=review

>>> Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:329
>>> +                collated = 0;
>> 
>> This puzzled me. Why do you set collated to 0 in this case? Is it so that if there are uncollated copies left the count will start from scratch?
> 
> No, there can't be collated and uncollated at the same time, they are mutually exclusive. When collatedCopiesLeft() is 0, it's because collated == collatedCopies - 1, so we reset it to 0, so that next page is collated again.

OK, makes sense
Comment 5 Carlos Garcia Campos 2012-02-17 10:08:39 PST
Committed r108089: <http://trac.webkit.org/changeset/108089>