AUDIT: r17883 - gnucash/trunk - Bug #462148: Fix multi-page printing on Win32 by using gtk_html_print_operation_run().

Andreas Köhler andi5 at cvs.gnucash.org
Sun Feb 8 09:06:29 EST 2009


Author: andi5
Date: 2009-02-08 09:06:28 -0500 (Sun, 08 Feb 2009)
New Revision: 17883
Trac: http://svn.gnucash.org/trac/changeset/17883

Modified:
   gnucash/trunk/configure.in
   gnucash/trunk/src/gnome-utils/gnc-html.c
Log:
Bug #462148: Fix multi-page printing on Win32 by using gtk_html_print_operation_run().

BP


Modified: gnucash/trunk/configure.in
===================================================================
--- gnucash/trunk/configure.in	2009-02-08 13:13:48 UTC (rev 17882)
+++ gnucash/trunk/configure.in	2009-02-08 14:06:28 UTC (rev 17883)
@@ -1163,6 +1163,18 @@
       AC_MSG_ERROR([Goffice uses Cairo/GtkPrint but didn't find GtkHTML with GtkPrint support])
     fi
 
+    # check for gtkhtml >= 3.16 (includes gtk_html_print_operation_run())
+    if test x$gtkhtml = x1; then
+      AC_MSG_CHECKING(for GtkHTML - version >= 3.16.0)
+      if $PKG_CONFIG 'libgtkhtml-3.14 >= 3.16.0'; then
+        AC_MSG_RESULT(yes)
+        AC_DEFINE(HAVE_GTKHTML_3_16,1,[System has gtkhtml 3.16.0 or better])
+        HAVE_GTKHTML_3_16=1
+      else
+        AC_MSG_RESULT(no)
+      fi
+    fi
+
     # fallback to older gtkhtml versions and gnomeprint
     if test x$gtkhtml = x0
     then

Modified: gnucash/trunk/src/gnome-utils/gnc-html.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-html.c	2009-02-08 13:13:48 UTC (rev 17882)
+++ gnucash/trunk/src/gnome-utils/gnc-html.c	2009-02-08 14:06:28 UTC (rev 17883)
@@ -1226,6 +1226,7 @@
 }
 
 #ifdef GTKHTML_USES_GTKPRINT
+#ifndef HAVE_GTKHTML_3_16
 static void
 draw_page_cb(GtkPrintOperation *operation, GtkPrintContext *context,
              gint page_nr, gpointer user_data)
@@ -1234,6 +1235,7 @@
 
     gtk_html_print_page((GtkHTML*) html->html, context);
 }
+#endif
 
 void
 gnc_html_print(gnc_html *html)
@@ -1246,11 +1248,18 @@
     gnc_print_operation_init(print);
     gtk_print_operation_set_use_full_page(print, FALSE);
     gtk_print_operation_set_unit(print, GTK_UNIT_POINTS);
+
+#ifdef HAVE_GTKHTML_3_16
+    res = gtk_html_print_operation_run((GtkHTML*) html->html, print,
+                                       GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
+                                       GTK_WINDOW(html->window), NULL, NULL,
+                                       NULL, NULL, NULL, NULL);
+#else
     gtk_print_operation_set_n_pages(print, 1);
     g_signal_connect(print, "draw_page", G_CALLBACK(draw_page_cb), html);
-
     res = gtk_print_operation_run(print, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
                                   GTK_WINDOW(html->window), NULL);
+#endif
 
     if (res == GTK_PRINT_OPERATION_RESULT_APPLY)
         gnc_print_operation_save_print_settings(print);



More information about the gnucash-changes mailing list