diff options
Diffstat (limited to 'gtk/gtkpapersize.c')
-rw-r--r-- | gtk/gtkpapersize.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/gtk/gtkpapersize.c b/gtk/gtkpapersize.c index db6a34b98..4c014808a 100644 --- a/gtk/gtkpapersize.c +++ b/gtk/gtkpapersize.c @@ -455,8 +455,23 @@ gtk_paper_size_get_paper_sizes (gboolean include_custom) GList *list = NULL; guint i; #ifdef G_OS_UNIX /* _gtk_load_custom_papers() only on Unix so far */ - if (include_custom) - list = _gtk_load_custom_papers (); + if (include_custom) + { + GList *page_setups, *l; + + page_setups = _gtk_load_custom_papers (); + for (l = page_setups; l != NULL; l = l->next) + { + GtkPageSetup *setup = (GtkPageSetup *) l->data; + GtkPaperSize *size; + + size = gtk_page_setup_get_paper_size (setup); + list = g_list_prepend (list, gtk_paper_size_copy (size)); + } + + g_list_foreach (page_setups, (GFunc) g_object_unref, NULL); + g_list_free (page_setups); + } #endif for (i = 0; i < G_N_ELEMENTS (standard_names_offsets); ++i) { |