mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-18 15:55:36 +00:00
Bug 1654982
- Ensure job disposition is set correctly for output to a file. r=nordzilla
Differential Revision: https://phabricator.services.mozilla.com/D84906
This commit is contained in:
parent
cacf827e99
commit
55aa3ada5a
@ -224,6 +224,10 @@ NS_IMETHODIMP nsDeviceContextSpecX::Init(nsIWidget* aWidget, nsIPrintSettings* a
|
||||
bool toFile;
|
||||
settings->GetPrintToFile(&toFile);
|
||||
|
||||
if (toFile) {
|
||||
settings->SetDispositionSaveToFile();
|
||||
}
|
||||
|
||||
bool toPrinter = !toFile && !aIsPrintPreview;
|
||||
if (!toPrinter) {
|
||||
double width, height;
|
||||
|
@ -85,6 +85,8 @@ class nsPrintSettingsX : public nsPrintSettings {
|
||||
// Set the printer name using the native PrintInfo data.
|
||||
void SetPrinterNameFromPrintInfo();
|
||||
|
||||
void SetDispositionSaveToFile();
|
||||
|
||||
protected:
|
||||
virtual ~nsPrintSettingsX();
|
||||
|
||||
|
@ -421,6 +421,14 @@ nsPrintSettingsX::SetToFileName(const nsAString& aToFileName) {
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
void nsPrintSettingsX::SetDispositionSaveToFile() {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
||||
[mPrintInfo setJobDisposition:NSPrintSaveJob];
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPrintSettingsX::GetOrientation(int32_t* aOrientation) {
|
||||
// Only use NSPrintInfo data in the parent process. The
|
||||
|
Loading…
Reference in New Issue
Block a user