Fix retrieving paper size and orientation from GTK print dialog
The paper size and orientation in wxPrintData were never updated because we didn't retrieve them from GTK correctly: they need to be extracted from "default-page-setup" property and not the main GtkPrintSettings themselves, at least with GTK 3.
This commit is contained in:
@@ -724,6 +724,19 @@ int wxGtkPrintDialog::ShowModal()
|
||||
|
||||
// Now get the settings and save it.
|
||||
GtkPrintSettings* newSettings = gtk_print_operation_get_print_settings(printOp);
|
||||
|
||||
// When embedding the page setup tab into the dialog, as we do, changes to
|
||||
// the settings such as the paper size and orientation there are not
|
||||
// reflected in the print settings, but must be retrieved from the page
|
||||
// setup struct itself separately.
|
||||
GtkPageSetup* defPageSetup = NULL;
|
||||
g_object_get(printOp, "default-page-setup", &defPageSetup, NULL);
|
||||
if ( defPageSetup )
|
||||
{
|
||||
native->SetPageSetupToSettings(newSettings, defPageSetup);
|
||||
g_object_unref(defPageSetup);
|
||||
}
|
||||
|
||||
native->SetPrintConfig(newSettings);
|
||||
data.ConvertFromNative();
|
||||
|
||||
|
Reference in New Issue
Block a user