[Bug 998156] Re: GTK Print dialog sends broken custom page size attribute: "PageSize=Custom.Custom.<width>x<length>"
TJ
998156 at bugs.launchpad.net
Fri Jul 27 14:27:36 UTC 2012
In modules/printbackends/cups/gtkprintbackendcups.c:
static void
add_cups_options (const gchar *key,
const gchar *value,
gpointer user_data)
{
...
/* Add "Custom." prefix to custom values. */
if (custom_value)
{
new_value = g_strdup_printf ("Custom.%s", value);
gtk_cups_request_encode_option (request, key, new_value);
g_free (new_value);
}
else
gtk_cups_request_encode_option (request, key, value);
}
This is called from:
static void gtk_print_backend_cups_print_stream (...) {
...
gtk_print_settings_foreach (settings, add_cups_options, options_data);
...
}
which is called via the ops pointer print_stream:
backend_class->print_stream = gtk_print_backend_cups_print_stream;
The "Custom." code was added:
commit 8170436e61ea68c713d75ad374d22c3261be9203
Author: Benjamin Berg <benjamin at sipsolutions.net>
Date: Sat Dec 24 17:26:32 2011 +0100
Set cups Custom print options correctly (bug #543520, patch by Marek Kašík)
This patch fixes the cups print backend to pass Custom options with
the "Custom." prefix to cups if neccessary.
https://bugzilla.gnome.org/show_bug.cgi?id=543520
In comment nos. 25 and 27 of that report Benjamin Berg describes this
"Custom." prefix problem and a patch to remove it when the GTK+ print
dialog. Commit 8170436e61ea68 was found to cause a crash in Thunderbird
and Inkscape, and was subsequently revised by commit 9afe13bf91.
commit 9afe13bf91d8e80c4def7d3944d56542ce13733f
Author: Marek Kasik <mkasik at redhat.com>
Date: Tue Jan 31 12:15:43 2012 +0100
printing: Don't crash when printing
This commit fixes crash which occurs in Firefox, Thunderbird and Inkscape
during printing. This crash was caused because of wrong handling of Custom
CUPS options. (#543520)
These commits are included in Ubuntu's 3.4.2 release.
My suspicion is that this code in create_pickone_option () {
...
if (option->type != GTK_PRINTER_OPTION_TYPE_PICKONE)
{
if (g_str_has_prefix (ppd_option->defchoice, "Custom."))
gtk_printer_option_set (option, ppd_option->defchoice + 7);
else
gtk_printer_option_set (option, ppd_option->defchoice);
}
else
...
}
isn't being executed in some circumstances, leading to the "Custom."
prefix received from CUPS then being further prefixed by
add_cups_options() when the ->print_stream op is called.
** Bug watch added: GNOME Bug Tracker #543520
https://bugzilla.gnome.org/show_bug.cgi?id=543520
--
You received this bug notification because you are a member of Mozilla
Bugs, which is subscribed to firefox in Ubuntu.
https://bugs.launchpad.net/bugs/998156
Title:
GTK Print dialog sends broken custom page size attribute:
"PageSize=Custom.Custom.<width>x<length>"
To manage notifications about this bug go to:
https://bugs.launchpad.net/gtk/+bug/998156/+subscriptions
More information about the Ubuntu-mozillateam-bugs
mailing list