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.)
Created attachment 46380 [details] Extend and improve example print implementation
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 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
Landed in http://trac.webkit.org/changeset/53154.
(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.