src/macosx/native/sun/awt/CPrinterJob.m

Print this page

        

@@ -521,10 +521,14 @@
         PrinterView* printerView = [[PrinterView alloc] initWithFrame:JavaToNSRect(env, pageFormatArea) withEnv:env withPrinterJob:jthis];
         [printerView setFirstPage:firstPage lastPage:lastPage];
 
         NSPrintInfo* printInfo = (NSPrintInfo*)jlong_to_ptr(JNFCallLongMethod(env, jthis, sjm_getNSPrintInfo)); // AWT_THREADING Safe (known object)
 
+        // <rdar://problem/4367998> JTable.print attributes are ignored
+        jobject pageable = JNFCallObjectMethod(env, jthis, jm_getPageable); // AWT_THREADING Safe (!appKit)
+        javaPrinterJobToNSPrintInfo(env, jthis, pageable, printInfo);
+
         // <rdar://problem/4156975> passing jthis CPrinterJob as well, so we can extract the printer name from the current job
         javaPageFormatToNSPrintInfo(env, jthis, page, printInfo);
 
         // <rdar://problem/4093799> NSPrinterInfo is not correctly set to the selected printer
         // from the Java side of CPrinterJob. Had always assumed the default printer was the one we wanted.

@@ -535,14 +539,10 @@
                 NSPrinter *printer = [NSPrinter printerWithName:printerName];
                 if (printer != nil) [printInfo setPrinter:printer];
             }
         }
 
-        // <rdar://problem/4367998> JTable.print attributes are ignored
-        jobject pageable = JNFCallObjectMethod(env, jthis, jm_getPageable); // AWT_THREADING Safe (!appKit)
-        javaPrinterJobToNSPrintInfo(env, jthis, pageable, printInfo);
-
         PrintModel* printModel = [[PrintModel alloc] initWithPrintInfo:printInfo];
 
         (void)[printModel runPrintLoopWithView:printerView waitUntilDone:blocks withEnv:env];
 
         // Only set this if we got far enough to call runPrintLoopWithView, or we will spin CPrinterJob.print() forever!