Skip to content

Commit

Permalink
Exclude OuptutBin from supported category if number of output bins is…
Browse files Browse the repository at this point in the history
… zero
  • Loading branch information
AlexanderScherbatiy committed May 21, 2024
1 parent 1fed0eb commit e3c335c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/java.desktop/unix/classes/sun/print/IPPPrintService.java
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,11 @@ public synchronized Class<?>[] getSupportedAttributeCategories() {
(PrintRequestAttribute)printReqAttribDefault[i];
if (getAttMap != null &&
getAttMap.containsKey(pra.getName()+"-supported")) {

if (pra == OutputBin.TOP && (outputBins == null || outputBins.length == 0)) {
continue;
}

catList.add(pra.getCategory());
}
}
Expand Down Expand Up @@ -1209,6 +1214,11 @@ public synchronized Class<?>[] getSupportedAttributeCategories() {
return true;
}

if (category == OutputBin.class
&& (outputBins == null || outputBins.length == 0)) {
return false;
}

for (int i=0;i<supportedCats.length;i++) {
if (category == supportedCats[i]) {
return true;
Expand Down

0 comments on commit e3c335c

Please sign in to comment.