jdk/src/java.desktop/unix/native/common/sun/awt/CUPSfuncs.c
changeset 26354 2d04e6c7ed68
parent 25859 3317bb8137f4
equal deleted inserted replaced
26353:b5e3b7fbf56d 26354:2d04e6c7ed68
   434 
   434 
   435     const char *name = (*env)->GetStringUTFChars(env, printer, NULL);
   435     const char *name = (*env)->GetStringUTFChars(env, printer, NULL);
   436     if (name == NULL) {
   436     if (name == NULL) {
   437         (*env)->ExceptionClear(env);
   437         (*env)->ExceptionClear(env);
   438         JNU_ThrowOutOfMemoryError(env, "Could not create printer name");
   438         JNU_ThrowOutOfMemoryError(env, "Could not create printer name");
       
   439         return;
   439     }
   440     }
   440     const char *filename;
   441     const char *filename;
   441 
   442 
   442     // NOTE: cupsGetPPD returns a pointer to a filename of a temporary file.
   443     // NOTE: cupsGetPPD returns a pointer to a filename of a temporary file.
   443     // unlink() must be called to remove the file after using it.
   444     // unlink() must be called to remove the file after using it.
   465                    defy = defx;
   466                    defy = defx;
   466                 }
   467                 }
   467             }
   468             }
   468         }
   469         }
   469         if (defx > 0) {
   470         if (defx > 0) {
   470           jobject rxObj = (*env)->NewObject(env, intCls, intCtr, defx);
   471           jobject rxObj, ryObj;
   471           jobject ryObj = (*env)->NewObject(env, intCls, intCtr, defy);
   472           rxObj = (*env)->NewObject(env, intCls, intCtr, defx);
       
   473           CHECK_NULL(rxObj);
       
   474           ryObj = (*env)->NewObject(env, intCls, intCtr, defy);
       
   475           CHECK_NULL(ryObj);
   472           (*env)->CallBooleanMethod(env, arrayList, arrListAddMID, rxObj);
   476           (*env)->CallBooleanMethod(env, arrayList, arrListAddMID, rxObj);
   473           (*env)->CallBooleanMethod(env, arrayList, arrListAddMID, ryObj);
   477           (*env)->CallBooleanMethod(env, arrayList, arrListAddMID, ryObj);
   474         }
   478         }
   475 
   479 
   476         for (i = 0; i < resolution->num_choices; i++) {
   480         for (i = 0; i < resolution->num_choices; i++) {
   490                        resy = resx;
   494                        resy = resx;
   491                     }
   495                     }
   492                 }
   496                 }
   493             }
   497             }
   494             if (resx > 0 && (resx != defx || resy != defy )) {
   498             if (resx > 0 && (resx != defx || resy != defy )) {
   495               jobject rxObj = (*env)->NewObject(env, intCls, intCtr, resx);
   499               jobject rxObj, ryObj;
   496               jobject ryObj = (*env)->NewObject(env, intCls, intCtr, resy);
   500               rxObj = (*env)->NewObject(env, intCls, intCtr, resx);
       
   501               CHECK_NULL(rxObj);
       
   502               ryObj = (*env)->NewObject(env, intCls, intCtr, resy);
       
   503               CHECK_NULL(ryObj);
   497               (*env)->CallBooleanMethod(env, arrayList, arrListAddMID, rxObj);
   504               (*env)->CallBooleanMethod(env, arrayList, arrListAddMID, rxObj);
   498               (*env)->CallBooleanMethod(env, arrayList, arrListAddMID, ryObj);
   505               (*env)->CallBooleanMethod(env, arrayList, arrListAddMID, ryObj);
   499             }
   506             }
   500         }
   507         }
   501     }
   508     }