Bug 1605412. Remove the Mac widget NS_PAPER_ORIENTATION_* defines. r=spohl

The oldest Mac that we support is 10.9, so we no longer need these defines.

Differential Revision: https://phabricator.services.mozilla.com/D58005

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jonathan Watt 2019-12-21 20:23:20 +00:00
Родитель 06456f883d
Коммит e8d7284c52
3 изменённых файлов: 5 добавлений и 18 удалений

Просмотреть файл

@ -88,7 +88,7 @@ nsresult nsPrintSettingsServiceX::SerializeToPrintDataParent(nsIPrintSettings* a
data->scalingFactor() = scalingFactor;
int32_t orientation;
if ([printInfo orientation] == NS_PAPER_ORIENTATION_PORTRAIT) {
if ([printInfo orientation] == NSPaperOrientationPortrait) {
orientation = nsIPrintSettings::kPortraitOrientation;
} else {
orientation = nsIPrintSettings::kLandscapeOrientation;

Просмотреть файл

@ -9,19 +9,6 @@
#include "nsPrintSettingsImpl.h"
#import <Cocoa/Cocoa.h>
// The constants for paper orientation were renamed in 10.9. __MAC_10_9 is
// defined on OS X 10.9 and later. Although 10.8 and earlier are not supported
// at this time, this allows for building on those older OS versions. The
// values are consistent across OS versions so the rename does not affect
// runtime, just compilation.
#ifdef __MAC_10_9
# define NS_PAPER_ORIENTATION_PORTRAIT (NSPaperOrientationPortrait)
# define NS_PAPER_ORIENTATION_LANDSCAPE (NSPaperOrientationLandscape)
#else
# define NS_PAPER_ORIENTATION_PORTRAIT (NSPortraitOrientation)
# define NS_PAPER_ORIENTATION_LANDSCAPE (NSLandscapeOrientation)
#endif
#define NS_PRINTSETTINGSX_IID \
{ \
0x0DF2FDBD, 0x906D, 0x4726, { \

Просмотреть файл

@ -331,7 +331,7 @@ nsPrintSettingsX::GetOrientation(int32_t* aOrientation) {
// Only use NSPrintInfo data in the parent process. The
// child process' instance is not needed or used.
if (XRE_IsParentProcess()) {
if ([mPrintInfo orientation] == NS_PAPER_ORIENTATION_PORTRAIT) {
if ([mPrintInfo orientation] == NSPaperOrientationPortrait) {
*aOrientation = nsIPrintSettings::kPortraitOrientation;
} else {
*aOrientation = nsIPrintSettings::kLandscapeOrientation;
@ -351,10 +351,10 @@ nsPrintSettingsX::SetOrientation(int32_t aOrientation) {
if (XRE_IsParentProcess()) {
NSMutableDictionary* printInfoDict = [mPrintInfo dictionary];
if (aOrientation == nsIPrintSettings::kPortraitOrientation) {
[printInfoDict setObject:[NSNumber numberWithInt:NS_PAPER_ORIENTATION_PORTRAIT]
[printInfoDict setObject:[NSNumber numberWithInt:NSPaperOrientationPortrait]
forKey:NSPrintOrientation];
} else {
[printInfoDict setObject:[NSNumber numberWithInt:NS_PAPER_ORIENTATION_LANDSCAPE]
[printInfoDict setObject:[NSNumber numberWithInt:NSPaperOrientationLandscape]
forKey:NSPrintOrientation];
}
} else {
@ -454,7 +454,7 @@ nsresult nsPrintSettingsX::SetCocoaPaperSize(double aWidth, double aHeight) {
NSSize paperSize;
NSMutableDictionary* printInfoDict = [mPrintInfo dictionary];
if ([mPrintInfo orientation] == NS_PAPER_ORIENTATION_PORTRAIT) {
if ([mPrintInfo orientation] == NSPaperOrientationPortrait) {
// switch widths and heights
paperSize = NSMakeSize(aWidth, aHeight);
[printInfoDict setObject:[NSValue valueWithSize:paperSize] forKey:NSPrintPaperSize];