mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 13:25:37 +00:00
make calendar printing work with toolkit, so sunbird can print again
bug 270245, r=mostafah
This commit is contained in:
parent
428b8a8546
commit
b216d4fa16
@ -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;'>";
|
||||
|
@ -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
|
||||
|
@ -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 ;
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
@ -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");
|
||||
}
|
||||
|
@ -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");
|
||||
}
|
||||
|
@ -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");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user