Last Comment Bug 126978 - MFCEmbed - Print Preview crashes browser
: MFCEmbed - Print Preview crashes browser
Status: VERIFIED FIXED
:
Product: Core
Classification: Components
Component: Embedding: APIs (show other bugs)
: Trunk
: x86 Windows XP
: -- normal (vote)
: ---
Assigned To: rods (gone)
: David Epstein
: Myk Melez [:myk] [@mykmelez]
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2002-02-21 04:54 PST by amutch
Modified: 2002-06-09 13:00 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description amutch 2002-02-21 04:54:10 PST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:0.9.8) Gecko/20020204
BuildID:    MFCEmbed nightly build 20020220

Selecting Print Preview crashes the browser

Reproducible: Always
Steps to Reproduce:
1. Select File - Print Preview


Actual Results:  Browser crashes with an error reported in gkgfxwin.dll


Expected Results:  Browser should display web page in Print Preview mode.

This has been happening in builds for at least a week.
Comment 1 Adam Lock 2002-02-21 05:20:01 PST
-> Chak
Comment 2 Chak Nanga 2002-02-21 08:17:03 PST
Printing related.

->rods
Comment 3 Jeff Doozan 2002-03-11 22:41:32 PST
The problem is in the CreateBrowser function:

http://lxr.mozilla.org/seamonkey/source/embedding/tests/mfcembed/BrowserView.cpp#271

nsCOMPtr<nsIWebBrowserPrint> print(do_GetInterface(mWebBrowser));
if (print) {
   print->GetNewPrintSettings(getter_AddRefs(m_PrintSettings));
}

"print" is always null.  Perhaps the nsIWebBrowserPrint stuff hasn't been
created/initialized at this point.

One quick hack is to simply add a check for m_PrintSettings in each of the
functions that use it (OnFilePrint, OnFilePrintPreview, and OnFilePrintSetup):

// Get the printer settings
if (!m_PrintSettings)
   print->GetNewPrintSettings(getter_AddRefs(m_PrintSettings));

but I think a cleaner solution would be best.


This is also relevant to bug 126976
Comment 4 amutch 2002-05-28 17:14:40 PDT
This seems to be working in MFCEmbed 4/28/2002 nightly build. 
Comment 5 David Epstein 2002-06-07 18:57:57 PDT
per amutch this bug is fixed. wfm on NT.
Comment 6 David Epstein 2002-06-09 13:00:17 PDT
per amutch, not crashing on XP, verified. Mozilla 1.1a Gecko/20020607 build.

Note You need to log in before you can comment on or make changes to this bug.