Bug 33537 - [Windows] More Complete Print Implementation
Summary: [Windows] More Complete Print Implementation
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Brent Fulgham
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-12 09:47 PST by Brent Fulgham
Modified: 2010-01-12 16:59 PST (History)
1 user (show)

See Also:


Attachments
Extend and improve example print implementation (6.80 KB, patch)
2010-01-12 09:56 PST, Brent Fulgham
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2010-01-12 09:47:23 PST
Provide a slightly more complete (and correct) implementation of printing in the WinLauncher example program.

This change includes the following:

1.  Print the pages only one time.  Current loop starts at page 0, which tells the print spooler to print all pages.  Then it prints the pages individually.  This results in double printing into the device context, which can create weird print output.

2.  Provide a header and footer implementation that is slightly more useful (showing page numbers and a separating line.)
Comment 1 Brent Fulgham 2010-01-12 09:56:58 PST
Created attachment 46380 [details]
Extend and improve example print implementation
Comment 2 WebKit Review Bot 2010-01-12 09:59:29 PST
Attachment 46380 [details] did not pass style-queue:

Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1
Last 3072 characters of output:
Launcher/PrintWebUIDelegate.cpp:164:  Extra space after ( in function call  [whitespace/parens] [4]
WebKitTools/WinLauncher/PrintWebUIDelegate.cpp:165:  Declaration has space between type name and * in IWebView *webView  [whitespace/declaration] [3]
WebKitTools/WinLauncher/PrintWebUIDelegate.cpp:166:  Declaration has space between type name and * in RECT *rect  [whitespace/declaration] [3]
WebKitTools/WinLauncher/PrintWebUIDelegate.cpp:171:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
WebKitTools/WinLauncher/PrintWebUIDelegate.cpp:174:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
WebKitTools/WinLauncher/PrintWebUIDelegate.cpp:176:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
WebKitTools/WinLauncher/PrintWebUIDelegate.cpp:177:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
WebKitTools/WinLauncher/PrintWebUIDelegate.cpp:179:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
WebKitTools/WinLauncher/PrintWebUIDelegate.cpp:180:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
WebKitTools/WinLauncher/PrintWebUIDelegate.cpp:180:  Should have a space between // and comment  [whitespace/comments] [4]
WebKitTools/WinLauncher/PrintWebUIDelegate.cpp:181:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
WebKitTools/WinLauncher/PrintWebUIDelegate.cpp:183:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
WebKitTools/WinLauncher/PrintWebUIDelegate.cpp:184:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
WebKitTools/WinLauncher/PrintWebUIDelegate.cpp:185:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
WebKitTools/WinLauncher/PrintWebUIDelegate.cpp:186:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
WebKitTools/WinLauncher/PrintWebUIDelegate.cpp:187:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
WebKitTools/WinLauncher/PrintWebUIDelegate.cpp:188:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
WebKitTools/WinLauncher/PrintWebUIDelegate.cpp:190:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
WebKitTools/WinLauncher/PrintWebUIDelegate.cpp:191:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
WebKitTools/WinLauncher/PrintWebUIDelegate.cpp:193:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
WebKitTools/WinLauncher/PrintWebUIDelegate.cpp:196:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 59
Comment 3 Darin Adler 2010-01-12 11:01:12 PST
Comment on attachment 46380 [details]
Extend and improve example print implementation

> +    //rect->right -= MARGIN; 
> +    //rect->bottom -= MARGIN;

Why leave commented-out code in?

> +   HDC dc = ::GetDC (0);
> +
> +   TEXTMETRIC textMetric;
> +   ::GetTextMetrics (dc, &textMetric);
> +   ::ReleaseDC (0, dc);

Spaces before parentheses here, not usually our style.

Looks OK, rs=me
Comment 4 Brent Fulgham 2010-01-12 12:34:55 PST
Landed in http://trac.webkit.org/changeset/53154.
Comment 5 Brent Fulgham 2010-01-12 12:35:26 PST
(In reply to comment #3)
> (From update of attachment 46380 [details])
> > +    //rect->right -= MARGIN; 
> > +    //rect->bottom -= MARGIN;
> 
> Why leave commented-out code in?

Mistake!  Removed.

> > +   HDC dc = ::GetDC (0);
> > +
> > +   TEXTMETRIC textMetric;
> > +   ::GetTextMetrics (dc, &textMetric);
> > +   ::ReleaseDC (0, dc);
> 
> Spaces before parentheses here, not usually our style.

Fixed.

> Looks OK, rs=me

Landed.  Thanks for the review.