Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 344878

Summary: Unprotected call to PrintDlg in WebUIDelegate.printFrame
Product: [Eclipse Project] Platform Reporter: Carolyn MacLeod <carolynmacleod4>
Component: SWTAssignee: Lakshmi P Shanmugam <lshanmug>
Status: RESOLVED FIXED QA Contact: Grant Gayed <grant_gayed>
Severity: normal    
Priority: P3 Flags: grant_gayed: review+
Version: 3.7   
Target Milestone: 3.7 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
patch none

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.