Closed
Bug 370029
Opened 18 years ago
Closed 18 years ago
Stop using gParentWnd in nsDeviceContextSpecWin
Categories
(Core :: Widget: Win32, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: sharparrow1, Assigned: sharparrow1)
Details
Attachments
(1 file, 1 obsolete file)
8.51 KB,
patch
|
emaijala+moz
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
Straigntforward patch. The primary justification for doing this is the subsequent removal of the aWidget parameter to nsIDeviceContextSpec::Init. Also, using a global to store an hwnd is very dangerous, and could crash if DisplayPropertiesDlg were ever actually called on Windows.
Attachment #254704 -
Flags: review?(emaijala)
Assignee | ||
Comment 1•18 years ago
|
||
(I just noticed the spelling error; fixed in my tree.)
Comment 2•18 years ago
|
||
Comment on attachment 254704 [details] [diff] [review] Patch You could still use the window handle in Init even though it's not stored in a global anymore, no? At least MSDN isn't saying hWnd can be NULL so it's better it isn't. Make DisplayPropertiesDlg return NS_OK so we're on par with most of the other implementations.
Attachment #254704 -
Flags: review?(emaijala) → review-
Assignee | ||
Comment 3•18 years ago
|
||
(In reply to comment #2) > (From update of attachment 254704 [details] [diff] [review]) > You could still use the window handle in Init even though it's not stored in a > global anymore, no? At least MSDN isn't saying hWnd can be NULL so it's better > it isn't. Passing in NULL is perfectly safe if you're not asking DocumentProperties to display anything. Logically, it wouldn't make any sense, because the settings for a printer shouldn't change depending on which window you happen to be asking from. Microsoft examples have no problem passing in NULL (i.e. http://support.microsoft.com/kb/140285). Plus, we aren't even guaranteed that Init() will be called before GetDataFromPrinter (see InitPrintSettingsFromPrinter, and nsGlobalWindow::Print which calls it). We've been passing in NULL for DocumentProperties already without any problems. I'd like to get rid of the aWidget parameter to nsIDeviceContextSpec::Init, and that's dependent on not using it anymore on Windows. > Make DisplayPropertiesDlg return NS_OK so we're on par with most of the other > implementations. Okay.
Assignee | ||
Comment 4•18 years ago
|
||
Attachment #254704 -
Attachment is obsolete: true
Attachment #255553 -
Flags: review?(emaijala)
Comment 5•18 years ago
|
||
Comment on attachment 255553 [details] [diff] [review] Patch v2 Ok then :) r=emaijala
Attachment #255553 -
Flags: review?(emaijala) → review+
Assignee | ||
Updated•18 years ago
|
Attachment #255553 -
Flags: superreview?(roc)
Attachment #255553 -
Flags: superreview?(roc) → superreview+
Assignee | ||
Comment 6•18 years ago
|
||
Checked in.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•