8016737: After clicking on "Print UNCOLLATED" button, the print out come in order 'Page 1', 'Page 2', 'Page 1'
authorjgodinez
Wed, 10 Jul 2013 11:49:04 -0700
changeset 18752 2a4f599c6bff
parent 18751 60debf1e00b2
child 18753 495f4c384864
child 19006 fcda25164f7d
8016737: After clicking on "Print UNCOLLATED" button, the print out come in order 'Page 1', 'Page 2', 'Page 1' Reviewed-by: jchen, prr
jdk/src/solaris/classes/sun/print/IPPPrintService.java
jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java
--- a/jdk/src/solaris/classes/sun/print/IPPPrintService.java	Fri Jul 05 12:26:27 2013 -0700
+++ b/jdk/src/solaris/classes/sun/print/IPPPrintService.java	Wed Jul 10 11:49:04 2013 -0700
@@ -1029,7 +1029,16 @@
             // now supports collation and that most OS has a way
             // of setting it, it is a safe assumption to just always
             // include SheetCollate as supported attribute.
-            catList.add(SheetCollate.class);
+
+            /*
+               In Linux, we use Postscript for rendering but Linux still
+               has issues in propagating Postscript-embedded setpagedevice
+               setting like collation.  Therefore, we temporarily exclude
+               Linux.
+            */
+            if (!UnixPrintServiceLookup.isLinux()) {
+                catList.add(SheetCollate.class);
+            }
         }
 
         // With the assumption that  Chromaticity is equivalent to
--- a/jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java	Fri Jul 05 12:26:27 2013 -0700
+++ b/jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java	Wed Jul 10 11:49:04 2013 -0700
@@ -123,6 +123,10 @@
         return osname.equals("SunOS");
     }
 
+    static boolean isLinux() {
+        return (osname.equals("Linux"));
+    }
+
     static boolean isBSD() {
         return (osname.equals("Linux") ||
                 osname.contains("OS X"));