Fix for crash when printing emails - Bug #: 48437 - r: xxxxx

This commit is contained in:
rhp%netscape.com 2000-08-14 00:46:45 +00:00
Родитель d12fd633d0
Коммит 2f0f731831
2 изменённых файлов: 5 добавлений и 4 удалений

Просмотреть файл

@ -61,6 +61,7 @@ nsMsgPrintEngine::nsMsgPrintEngine() :
mWindow(nsnull)
{
mCurrentlyPrintingURI = -1;
mContentViewer = nsnull;
NS_INIT_REFCNT();
}
@ -97,7 +98,6 @@ nsMsgPrintEngine::OnEndDocumentLoad(nsIDocumentLoader *loader, nsIChannel *aChan
{
// Now, fire off the print operation!
nsresult rv = NS_ERROR_FAILURE;
nsCOMPtr<nsIContentViewer> viewer;
// Tell the user the message is loaded...
PRUnichar *msg = GetString(NS_ConvertASCIItoUCS2("MessageLoaded").GetUnicode());
@ -125,10 +125,10 @@ nsMsgPrintEngine::OnEndDocumentLoad(nsIDocumentLoader *loader, nsIChannel *aChan
}
}
mDocShell->GetContentViewer(getter_AddRefs(viewer));
if (viewer)
mDocShell->GetContentViewer(getter_AddRefs(mContentViewer));
if (mContentViewer)
{
nsCOMPtr<nsIContentViewerFile> viewerFile = do_QueryInterface(viewer);
nsCOMPtr<nsIContentViewerFile> viewerFile = do_QueryInterface(mContentViewer);
if (viewerFile)
{
if (mCurrentlyPrintingURI == 0)

Просмотреть файл

@ -71,6 +71,7 @@ protected:
nsStringArray mURIArray;
PRInt32 mCurrentlyPrintingURI;
nsCOMPtr<nsIContentViewer> mContentViewer;
nsCOMPtr<nsIStringBundle> mStringBundle; // String bundles...
nsCOMPtr<nsIMsgStatusFeedback> mFeedback; // Tell the user something why don't ya'
};