ramonlopes / jzebra

Automatically exported from code.google.com/p/jzebra
0 stars 0 forks source link

PrintServiceMatcher does not select desired printer #22

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. Business I work for has two Zebras. First is named zebra, but the second is 
zebar2. Possibly our clients will have this configuration too.
2. I am providing the applet with name zebra as a printer.

What is the expected output? What do you see instead?

I want to see the zebra printer to be seleected. Instead I see the zebra2 
printer.

What version of the product are you using? On what operating system?

jZebra 1.1.4

Please provide any additional information below.

In PrintServiceMatcher.java the line 56 is responsible for choosing the 
printer. It is using indexOf what is causing the first occurrance of the string 
to be selected. It should be changed to select the exact string.

Original issue reported on code.google.com by Tomasz.Z...@gmail.com on 24 Feb 2011 at 4:05

GoogleCodeExporter commented 8 years ago
Tres,

I understand why you did this that way - e.g. to avoid searching with the 
server name.  In that case it would be better to compare the printer names from 
the end of the string. What do you think?

Original comment by Tomasz.Z...@gmail.com on 25 Feb 2011 at 12:49

GoogleCodeExporter commented 8 years ago
Tomas,

This is a good point.  I should weigh matches that are exact higher than 
matches that are close.  I'll add this feature.

Original comment by tres.fin...@gmail.com on 25 Feb 2011 at 12:55

GoogleCodeExporter commented 8 years ago
Thanks Tres

Original comment by Tomasz.Z...@gmail.com on 25 Feb 2011 at 2:14

GoogleCodeExporter commented 8 years ago
Changes added, please test/verify.
http://code.google.com/p/jzebra/downloads/detail?name=jZebra%201.1.5.zip

Original comment by tres.fin...@gmail.com on 25 Feb 2011 at 5:07

GoogleCodeExporter commented 8 years ago

Original comment by tres.fin...@gmail.com on 25 Feb 2011 at 5:08

GoogleCodeExporter commented 8 years ago
Tres,

Working OK.

Original comment by Tomasz.Z...@gmail.com on 25 Feb 2011 at 8:15

GoogleCodeExporter commented 8 years ago
Thanks Tomasz.  Marking as fixed & verified.

Original comment by tres.fin...@gmail.com on 25 Feb 2011 at 4:46