mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 04:15:43 +00:00
Restore old code that prevents printing or previewing XUL documents, since it still doesn't work. b=240490 r+sr=roc
This commit is contained in:
parent
54cada1515
commit
d1da171a4f
@ -101,6 +101,7 @@ NS_ERROR_GFX_PRINTER_DOC_IS_BUSY_PP=The browser cannot print preview right now.\
|
||||
NS_ERROR_GFX_PRINTER_DOC_WAS_DESTORYED=The page was replaced while you were trying to print.\nPlease try again.
|
||||
NS_ERROR_GFX_NO_PRINTDIALOG_IN_TOOLKIT=Either pluggable dialogs were not properly installed\nOr this GFX Toolkit no longer supports native Print Dialogs
|
||||
NS_ERROR_GFX_NO_PRINTROMPTSERVICE=The Printing Prompt Service is missing.
|
||||
NS_ERROR_GFX_PRINTER_NO_XUL=We are unable to Print or Print Preview this page.
|
||||
NS_ERROR_GFX_PRINTER_XPRINT_NO_XPRINT_SERVERS_FOUND=There was a problem printing. No Xprint server(s) could be found.\nCheck whether the XPSERVERLIST environment variable contains any valid Xprint servers.\nFor further information see http://xprint.mozdev.org/ or http://www.mozilla.org/projects/xprint/
|
||||
NS_ERROR_GFX_PRINTER_PLEX_NOT_SUPPORTED=There was a problem printing because the plex mode you specified is not supported by your printer.
|
||||
NS_ERROR_GFX_PRINTER_DOC_IS_BUSY=The browser cannot print the document while it is being loaded.
|
||||
|
@ -109,7 +109,7 @@
|
||||
#include "nsCopySupport.h"
|
||||
#include "nsIDOMHTMLFrameSetElement.h"
|
||||
#ifdef MOZ_XUL
|
||||
#include "nsIXULDocument.h" // Temporary code for Bug 136185
|
||||
#include "nsIXULDocument.h"
|
||||
#endif
|
||||
|
||||
#include "nsIClipboardHelper.h"
|
||||
@ -3028,6 +3028,15 @@ DocumentViewerImpl::Print(nsIPrintSettings* aPrintSettings,
|
||||
#ifdef NS_PRINTING
|
||||
INIT_RUNTIME_ERROR_CHECKING();
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
// Temporary code for Bug 136185 / Bug 240490
|
||||
nsCOMPtr<nsIXULDocument> xulDoc(do_QueryInterface(mDocument));
|
||||
if (xulDoc) {
|
||||
nsPrintEngine::ShowPrintErrorDialog(NS_ERROR_GFX_PRINTER_NO_XUL);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
#endif
|
||||
|
||||
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(mContainer));
|
||||
NS_ASSERTION(docShell, "This has to be a docshell");
|
||||
|
||||
@ -3120,6 +3129,16 @@ DocumentViewerImpl::PrintPreview(nsIPrintSettings* aPrintSettings,
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
// Temporary code for Bug 136185 / Bug 240490
|
||||
nsCOMPtr<nsIXULDocument> xulDoc(do_QueryInterface(mDocument));
|
||||
if (xulDoc) {
|
||||
nsPrintEngine::CloseProgressDialog(aWebProgressListener);
|
||||
nsPrintEngine::ShowPrintErrorDialog(NS_ERROR_GFX_PRINTER_NO_XUL, PR_FALSE);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!mPrintEngine) {
|
||||
mPrintEngine = new nsPrintEngine();
|
||||
NS_ENSURE_TRUE(mPrintEngine, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
@ -2234,6 +2234,7 @@ nsPrintEngine::ShowPrintErrorDialog(nsresult aPrintError, PRBool aIsPrinting)
|
||||
NS_ERROR_TO_LOCALIZED_PRINT_ERROR_MSG(NS_ERROR_GFX_PRINTER_DOC_WAS_DESTORYED)
|
||||
NS_ERROR_TO_LOCALIZED_PRINT_ERROR_MSG(NS_ERROR_GFX_NO_PRINTDIALOG_IN_TOOLKIT)
|
||||
NS_ERROR_TO_LOCALIZED_PRINT_ERROR_MSG(NS_ERROR_GFX_NO_PRINTROMPTSERVICE)
|
||||
NS_ERROR_TO_LOCALIZED_PRINT_ERROR_MSG(NS_ERROR_GFX_PRINTER_NO_XUL) // Temporary code for Bug 136185 / bug 240490
|
||||
NS_ERROR_TO_LOCALIZED_PRINT_ERROR_MSG(NS_ERROR_GFX_PRINTER_XPRINT_NO_XPRINT_SERVERS_FOUND)
|
||||
NS_ERROR_TO_LOCALIZED_PRINT_ERROR_MSG(NS_ERROR_GFX_PRINTER_PLEX_NOT_SUPPORTED)
|
||||
NS_ERROR_TO_LOCALIZED_PRINT_ERROR_MSG(NS_ERROR_GFX_PRINTER_DOC_IS_BUSY)
|
||||
|
Loading…
Reference in New Issue
Block a user