< prev index next >

src/java.desktop/macosx/native/libawt_lwawt/awt/CPrinterJob.m

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 141,156 **** // the -[NSPrintInfo orientation] into account when setting the Paper // rectangle. NSSize paperSize = [src paperSize]; switch ([src orientation]) { ! case NSPortraitOrientation: jPaperW = paperSize.width; jPaperH = paperSize.height; break; ! case NSLandscapeOrientation: jPaperW = paperSize.height; jPaperH = paperSize.width; break; default: --- 141,156 ---- // the -[NSPrintInfo orientation] into account when setting the Paper // rectangle. NSSize paperSize = [src paperSize]; switch ([src orientation]) { ! case NSPaperOrientationPortrait: jPaperW = paperSize.width; jPaperH = paperSize.height; break; ! case NSPaperOrientationLandscape: jPaperW = paperSize.height; jPaperH = paperSize.width; break; default:
*** 215,231 **** static JNF_MEMBER_CACHE(jm_setOrientation, sjc_PageFormat, "setOrientation", "(I)V"); static JNF_MEMBER_CACHE(jm_setPaper, sjc_PageFormat, "setPaper", "(Ljava/awt/print/Paper;)V"); static JNF_CTOR_CACHE(jm_Paper_ctor, sjc_Paper, "()V"); jint jOrientation; ! NSPrintingOrientation nsOrientation = [src orientation]; switch (nsOrientation) { ! case NSPortraitOrientation: jOrientation = java_awt_print_PageFormat_PORTRAIT; break; ! case NSLandscapeOrientation: jOrientation = java_awt_print_PageFormat_LANDSCAPE; //+++gdb Are LANDSCAPE and REVERSE_LANDSCAPE still inverted? break; /* // AppKit printing doesn't support REVERSE_LANDSCAPE. Radar 2960295. --- 215,231 ---- static JNF_MEMBER_CACHE(jm_setOrientation, sjc_PageFormat, "setOrientation", "(I)V"); static JNF_MEMBER_CACHE(jm_setPaper, sjc_PageFormat, "setPaper", "(Ljava/awt/print/Paper;)V"); static JNF_CTOR_CACHE(jm_Paper_ctor, sjc_Paper, "()V"); jint jOrientation; ! NSPaperOrientation nsOrientation = [src orientation]; switch (nsOrientation) { ! case NSPaperOrientationPortrait: jOrientation = java_awt_print_PageFormat_PORTRAIT; break; ! case NSPaperOrientationLandscape: jOrientation = java_awt_print_PageFormat_LANDSCAPE; //+++gdb Are LANDSCAPE and REVERSE_LANDSCAPE still inverted? break; /* // AppKit printing doesn't support REVERSE_LANDSCAPE. Radar 2960295.
*** 271,294 **** javaPaperToNSPrintInfo(env, paper, dstPrintInfo); (*env)->DeleteLocalRef(env, paper); switch (JNFCallIntMethod(env, srcPageFormat, jm_getOrientation)) { // AWT_THREADING Safe (!appKit) case java_awt_print_PageFormat_PORTRAIT: ! [dstPrintInfo setOrientation:NSPortraitOrientation]; break; case java_awt_print_PageFormat_LANDSCAPE: ! [dstPrintInfo setOrientation:NSLandscapeOrientation]; //+++gdb Are LANDSCAPE and REVERSE_LANDSCAPE still inverted? break; // AppKit printing doesn't support REVERSE_LANDSCAPE. Radar 2960295. case java_awt_print_PageFormat_REVERSE_LANDSCAPE: ! [dstPrintInfo setOrientation:NSLandscapeOrientation]; //+++gdb Are LANDSCAPE and REVERSE_LANDSCAPE still inverted? break; default: ! [dstPrintInfo setOrientation:NSPortraitOrientation]; break; } // <rdar://problem/4022422> NSPrinterInfo is not correctly set to the selected printer // from the Java side of CPrinterJob. Has always assumed the default printer was the one we wanted. --- 271,294 ---- javaPaperToNSPrintInfo(env, paper, dstPrintInfo); (*env)->DeleteLocalRef(env, paper); switch (JNFCallIntMethod(env, srcPageFormat, jm_getOrientation)) { // AWT_THREADING Safe (!appKit) case java_awt_print_PageFormat_PORTRAIT: ! [dstPrintInfo setOrientation:NSPaperOrientationPortrait]; break; case java_awt_print_PageFormat_LANDSCAPE: ! [dstPrintInfo setOrientation:NSPaperOrientationLandscape]; //+++gdb Are LANDSCAPE and REVERSE_LANDSCAPE still inverted? break; // AppKit printing doesn't support REVERSE_LANDSCAPE. Radar 2960295. case java_awt_print_PageFormat_REVERSE_LANDSCAPE: ! [dstPrintInfo setOrientation:NSPaperOrientationLandscape]; //+++gdb Are LANDSCAPE and REVERSE_LANDSCAPE still inverted? break; default: ! [dstPrintInfo setOrientation:NSPaperOrientationPortrait]; break; } // <rdar://problem/4022422> NSPrinterInfo is not correctly set to the selected printer // from the Java side of CPrinterJob. Has always assumed the default printer was the one we wanted.
< prev index next >