Fixing viewer so it can print again.

This commit is contained in:
rods%netscape.com 2002-04-24 11:00:39 +00:00
Родитель 6ef0e88937
Коммит d562b821c5
2 изменённых файлов: 12 добавлений и 5 удалений

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

@ -76,6 +76,7 @@
#include "nsGUIEvent.h"
#include "nsIWebProgress.h"
#include "nsIWebBrowserSetup.h"
#include "nsIWebBrowserPrint.h"
#include "nsCWebBrowser.h"
#include "nsUnicharUtils.h"
@ -2206,11 +2207,13 @@ void nsBrowserWindow::DoPrint(void)
mDocShell->GetContentViewer(getter_AddRefs(viewer));
if (viewer)
{
nsCOMPtr<nsIContentViewerFile> viewerFile = do_QueryInterface(viewer);
if (viewerFile) {
//viewerFile->Print(PR_FALSE, nsnull, (nsIWebProgressListener*)nsnull);
if (viewer) {
nsCOMPtr<nsIWebBrowserPrint> webBrowserPrint = do_QueryInterface(viewer);
if (webBrowserPrint) {
if (!mPrintSettings) {
webBrowserPrint->GetNewPrintSettings(getter_AddRefs(mPrintSettings));
}
webBrowserPrint->Print(mPrintSettings, (nsIWebProgressListener*)nsnull);
}
}
}

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

@ -65,6 +65,8 @@
#include "nsImageInspectorDialog.h"
#include "nsITextWidget.h"
#include "nsIPrintSettings.h"
class nsILabel;
class nsICheckButton;
class nsIButton;
@ -276,6 +278,8 @@ protected:
nsWebBrowserChrome* mWebBrowserChrome;
PRBool mHaveMenuBar;
nsCOMPtr<nsIPrintSettings> mPrintSettings;
};
// XXX This is bad; because we can't hang a closure off of the event