mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-04 11:26:09 +00:00
Bug 1660296 - Implement Get/SetNumCopies in the macOS print settings backend. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D87880
This commit is contained in:
parent
a37d79921f
commit
e58849d935
@ -73,6 +73,9 @@ class nsPrintSettingsX : public nsPrintSettings {
|
||||
NS_IMETHOD GetOrientation(int32_t* aOrientation) override;
|
||||
NS_IMETHOD SetOrientation(int32_t aOrientation) override;
|
||||
|
||||
NS_IMETHOD GetNumCopies(int32_t* aCopies) override;
|
||||
NS_IMETHOD SetNumCopies(int32_t aCopies) override;
|
||||
|
||||
NS_IMETHOD SetUnwriteableMarginTop(double aUnwriteableMarginTop) override;
|
||||
NS_IMETHOD SetUnwriteableMarginLeft(double aUnwriteableMarginLeft) override;
|
||||
NS_IMETHOD SetUnwriteableMarginBottom(
|
||||
|
@ -495,6 +495,41 @@ nsPrintSettingsX::SetOrientation(int32_t aOrientation) {
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPrintSettingsX::GetNumCopies(int32_t* aCopies) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
||||
// Only use NSPrintInfo data in the parent process. The
|
||||
// child process' instance is not needed or used.
|
||||
if (XRE_IsParentProcess()) {
|
||||
NSDictionary* dict = [mPrintInfo dictionary];
|
||||
*aCopies = [[dict objectForKey:NSPrintCopies] intValue];
|
||||
} else {
|
||||
nsPrintSettings::GetNumCopies(aCopies);
|
||||
}
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPrintSettingsX::SetNumCopies(int32_t aCopies) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
||||
// Only use NSPrintInfo data in the parent process. The
|
||||
// child process' instance is not needed or used.
|
||||
if (XRE_IsParentProcess()) {
|
||||
NSMutableDictionary* dict = [mPrintInfo dictionary];
|
||||
[dict setObject:[NSNumber numberWithInt:aCopies] forKey:NSPrintCopies];
|
||||
} else {
|
||||
nsPrintSettings::SetNumCopies(aCopies);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPrintSettingsX::SetUnwriteableMarginTop(double aUnwriteableMarginTop) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
Loading…
Reference in New Issue
Block a user