< prev index next >

src/java.desktop/unix/classes/sun/print/CUPSPrinter.java

Print this page
*** 223,30 ***
              x = (float)(pageSizes[i*6+2]/PRINTER_DPI);
              h = (float)(pageSizes[i*6+3]/PRINTER_DPI);
              w = (float)(pageSizes[i*6+4]/PRINTER_DPI);
              y = (float)(pageSizes[i*6+5]/PRINTER_DPI);
  
!             msn = new CustomMediaSizeName(media[i*2], media[i*2+1],
!                                           width, length);
  
              // add to list of standard MediaSizeNames
              if ((cupsMediaSNames[i] = msn.getStandardMedia()) == null) {
                  // add custom if no matching standard media
                  cupsMediaSNames[i] = msn;
- 
-                 // add this new custom msn to MediaSize array
-                 if ((width > 0.0) && (length > 0.0)) {
-                     try {
-                     new MediaSize(width, length,
-                                   Size2DSyntax.INCH, msn);
-                     } catch (IllegalArgumentException e) {
-                         /* PDF printer in Linux for Ledger paper causes
-                         "IllegalArgumentException: X dimension > Y dimension".
-                         We rotate based on IPP spec. */
-                         new MediaSize(length, width, Size2DSyntax.INCH, msn);
-                     }
-                 }
              }
  
              // add to list of custom MediaSizeName
              // for internal use of IPPPrintService
              cupsCustomMediaSNames[i] = msn;
--- 223,17 ---
              x = (float)(pageSizes[i*6+2]/PRINTER_DPI);
              h = (float)(pageSizes[i*6+3]/PRINTER_DPI);
              w = (float)(pageSizes[i*6+4]/PRINTER_DPI);
              y = (float)(pageSizes[i*6+5]/PRINTER_DPI);
  
!             msn = CustomMediaSizeName.create(media[i*2], media[i*2+1],
!                                              width, length);
  
              // add to list of standard MediaSizeNames
              if ((cupsMediaSNames[i] = msn.getStandardMedia()) == null) {
                  // add custom if no matching standard media
                  cupsMediaSNames[i] = msn;
              }
  
              // add to list of custom MediaSizeName
              // for internal use of IPPPrintService
              cupsCustomMediaSNames[i] = msn;

*** 267,12 ***
          // initialize trays
          cupsMediaTrays = new MediaTray[nTrays];
  
          MediaTray mt;
          for (int i=0; i<nTrays; i++) {
!             mt = new CustomMediaTray(media[(nPageSizes+i)*2],
!                                      media[(nPageSizes+i)*2+1]);
              cupsMediaTrays[i] = mt;
          }
  
      }
  
--- 254,12 ---
          // initialize trays
          cupsMediaTrays = new MediaTray[nTrays];
  
          MediaTray mt;
          for (int i=0; i<nTrays; i++) {
!             mt = CustomMediaTray.create(media[(nPageSizes+i)*2],
!                                         media[(nPageSizes+i)*2+1]);
              cupsMediaTrays[i] = mt;
          }
  
      }
  
< prev index next >