[cups.bugs] [HIGH] STR #3642: ppdMarkOption does not unmark old values of PICK_ONE options

Benjamin Berg benjamin at sipsolutions.net
Sat Aug 14 02:59:03 PDT 2010


DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

If one looks into the ppd_mark_option function, there is an if clause:
  if ((oldc = (ppd_choice_t *)cupsArrayFind(ppd->marked, c)) != NULL)
however, this does *not* return the old choice. It only removes it if the
new choice is equal to the old choice.

Note that trunk is also affected AFAICT.

The symptoms in GTK+ are that basically for a PICK_ONE option multiple
choices are selected. For example, I got a printer that can do no
stapling, normal stapling and saddle stich stapling. Now, after having
selected normal stapling and saddle stich stapling at one point, GTK+ will
mark all of the output tray options as invalid.

I tried to add the following code before Marking an option in the GTK+
conflict handling code, and it works fine:
    for (i = 0; i < ppd_option->num_choices; i++)
      {
        if (ppd_option->choices[i].marked)
          {
            ppd_option->choices[i].marked = 0;
            cupsArrayRemove(ppd_file->marked, &ppd_option->choices[i]);
          }
      }

It is probably better to do the same thing inside cups instead though :-)

Link: http://www.cups.org/str.php?L3642
Version: 1.4.4





More information about the cups-devel mailing list