pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1888094 - /pdfbox/branches/2.0/tools/src/main/java/org/apache/pdfbox/tools/PrintPDF.java
Date Fri, 26 Mar 2021 18:41:43 GMT
Author: tilman
Date: Fri Mar 26 18:41:43 2021
New Revision: 1888094

URL: http://svn.apache.org/viewvc?rev=1888094&view=rev
Log:
PDFBOX-4892: refactor, as suggested by valerybokov

Modified:
    pdfbox/branches/2.0/tools/src/main/java/org/apache/pdfbox/tools/PrintPDF.java

Modified: pdfbox/branches/2.0/tools/src/main/java/org/apache/pdfbox/tools/PrintPDF.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/tools/src/main/java/org/apache/pdfbox/tools/PrintPDF.java?rev=1888094&r1=1888093&r2=1888094&view=diff
==============================================================================
--- pdfbox/branches/2.0/tools/src/main/java/org/apache/pdfbox/tools/PrintPDF.java (original)
+++ pdfbox/branches/2.0/tools/src/main/java/org/apache/pdfbox/tools/PrintPDF.java Fri Mar
26 18:41:43 2021
@@ -169,12 +169,13 @@ public final class PrintPDF
             {
                 PrintService[] printServices = PrinterJob.lookupPrintServices();
                 boolean printerFound = false;
-                for (int i = 0; !printerFound && i < printServices.length; i++)
+                for (int i = 0; i < printServices.length; i++)
                 {
                     if (printServices[i].getName().equals(printerName))
                     {
                         printJob.setPrintService(printServices[i]);
                         printerFound = true;
+                        break;
                     }
                 }
                 if (!printerFound)



Mime
View raw message