Bug 1821331 - For macOS printing, ensure paper orientation matches the dimensions being set. r=emilio

Depends on D174243

Differential Revision: https://phabricator.services.mozilla.com/D174244
This commit is contained in:
Jonathan Kew 2023-04-14 10:07:03 +00:00
Родитель d70ae79d9f
Коммит 89c7f7e5c3
1 изменённых файлов: 7 добавлений и 4 удалений

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

@ -106,15 +106,18 @@ NSPrintInfo* nsPrintSettingsX::CreateOrCopyPrintInfo(bool aWithScaling) {
NSSize paperSize;
if (GetSheetOrientation() == kPortraitOrientation) {
[printInfo setOrientation:NSPaperOrientationPortrait];
paperSize.width = CocoaPointsFromPaperSize(mPaperWidth);
paperSize.height = CocoaPointsFromPaperSize(mPaperHeight);
[printInfo setPaperSize:paperSize];
} else {
[printInfo setOrientation:NSPaperOrientationLandscape];
paperSize.width = CocoaPointsFromPaperSize(mPaperHeight);
paperSize.height = CocoaPointsFromPaperSize(mPaperWidth);
[printInfo setPaperSize:paperSize];
}
[printInfo setPaperSize:paperSize];
if (paperSize.width > paperSize.height) {
[printInfo setOrientation:NSPaperOrientationLandscape];
} else {
[printInfo setOrientation:NSPaperOrientationPortrait];
}
[printInfo setTopMargin:mUnwriteableMargin.top];