make calendar printing work with toolkit, so sunbird can print again

bug 270245, r=mostafah
This commit is contained in:
mvl%exedo.nl 2004-11-17 15:54:02 +00:00
parent 428b8a8546
commit b216d4fa16
7 changed files with 49 additions and 11 deletions

View File

@ -116,14 +116,19 @@ function BrowserPrintPreview()
try {
ifreq = content.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
webBrowserPrint = ifreq.getInterface(Components.interfaces.nsIWebBrowserPrint);
gPrintSettings = GetPrintSettings();
} catch (e) {
// Pressing cancel is expressed as an NS_ERROR_ABORT return value,
// causing an exception to be thrown which we catch here.
// Unfortunately this will also consume helpful failures, so add a
// dump(e); // if you need to debug
}
try {
gPrintSettings = GetPrintSettings();
} catch(e) {
gPrintSettings = PrintUtils.getPrintSettings();
}
gWebProgress = new Object();
var printPreviewParams = new Object();
@ -159,7 +164,11 @@ function FinishPrintPreview()
var ifreq = content.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
var webBrowserPrint = ifreq.getInterface(Components.interfaces.nsIWebBrowserPrint);
if (webBrowserPrint) {
gPrintSettings = GetPrintSettings();
try {
gPrintSettings = GetPrintSettings();
} catch(e) {
gPrintSettings = PrintUtils.getPrintSettings();
}
// Don't print the fake title and url
gPrintSettings.docURL=" ";
gPrintSettings.title=" ";
@ -249,6 +258,12 @@ function BrowserExitPrintPreview()
window.close();
}
// hack around the toolkit problems in bug 270235
function getBrowser()
{
BrowserExitPrintPreview();
}
function initHTMLView()
{
gHtmlString += "<html><head><title>"+windowTitle+"</title></head><body style='font-size:11px;'>";

View File

@ -19,13 +19,8 @@ Copyright (C) 1998-1999 Netscape Communications Corporation. All
Rights Reserved.
-->
<?xml-stylesheet href="chrome://communicator/content/communicator.css" type="text/css"?>
<?xml-stylesheet href="chrome://messenger/skin/dialogs.css" type="text/css"?>
<!--
?xul-overlay href="chrome://global/content/globalOverlay.xul"?
?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?
-->
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xml-stylesheet href="chrome://calendar/skin/calendar.css" type="text/css"?>
<!-- DTD File with all strings specific to the calendar -->
<!DOCTYPE dialog

View File

@ -151,7 +151,7 @@ function printInitWindow(printFunction,printFunctionArg)
"chrome,dialog=no,all,centerscreen",
printFunction,printFunctionArg,mytitle,showprivate,gArgs,gCalendarWindow );
// to set the title of the page
printwindow.title = printwindow.name ;
// printwindow.title = printwindow.name ;
return printwindow ;
}

View File

@ -1515,3 +1515,10 @@ description.tooltipBody
font-weight : normal;
white-space : normal;
}
/*--------------------------------------------------------------------
* print preview
*-------------------------------------------------------------------*/
toolbar[printpreview="true"] {
-moz-binding: url("chrome://global/content/printPreviewBindings.xml#printpreviewtoolbar");
}

View File

@ -1536,3 +1536,10 @@ description.tooltipBody
font-weight : normal;
white-space : normal;
}
/*--------------------------------------------------------------------
* print preview
*-------------------------------------------------------------------*/
toolbar[printpreview="true"] {
-moz-binding: url("chrome://global/content/printPreviewBindings.xml#printpreviewtoolbar");
}

View File

@ -2040,3 +2040,10 @@ description.tooltipBody
font-weight : normal;
white-space : normal;
}
/*--------------------------------------------------------------------
* print preview
*-------------------------------------------------------------------*/
toolbar[printpreview="true"] {
-moz-binding: url("chrome://global/content/printPreviewBindings.xml#printpreviewtoolbar");
}

View File

@ -2029,3 +2029,10 @@ description.tooltipBody
font-weight : normal;
white-space : normal;
}
/*--------------------------------------------------------------------
* print preview
*-------------------------------------------------------------------*/
toolbar[printpreview="true"] {
-moz-binding: url("chrome://global/content/printPreviewBindings.xml#printpreviewtoolbar");
}