Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 344878 - Unprotected call to PrintDlg in WebUIDelegate.printFrame
Summary: Unprotected call to PrintDlg in WebUIDelegate.printFrame
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.7 RC1   Edit
Assignee: Lakshmi P Shanmugam CLA
QA Contact: Grant Gayed CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-05 13:54 EDT by Carolyn MacLeod CLA
Modified: 2011-05-11 15:01 EDT (History)
0 users

See Also:
grant_gayed: review+


Attachments
patch (1.07 KB, patch)
2011-05-11 14:20 EDT, Lakshmi P Shanmugam CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carolyn MacLeod CLA 2011-05-05 13:54:48 EDT
In WebUIDelegate.printFrame() there is a call to OS.PrintDlg(pd) that should check for a return value of false, which means that there was some error in the printing system (probably related to a failure to properly get info for the default printer).

I am not sure what you want to do if false is returned at this point, but the bottom line is that you will not be able to print to the default printer, so you probably want to return without doing anything, or throw an error, or something.

Please see bug 344591 for background information.

CC'ing GG for discussion of "correct" failure method, and possible +1 for RC1.
Comment 1 Lakshmi P Shanmugam CLA 2011-05-11 14:20:22 EDT
Created attachment 195402 [details]
patch

Sorry, almost missed this bug.

OS.PrintDlg() returns false even when the user cancels the dialog. So the patch just returns from printFrame() if OS.PrintDlg() returns false.
Grant, please review.
Comment 2 Lakshmi P Shanmugam CLA 2011-05-11 15:01:56 EDT
Fixed in HEAD > 20110512
Thanks Grant.