Webkit status (updated)

Chris Dennis cgdennis at btinternet.com
Mon Mar 30 03:00:16 EDT 2009


Phil Longstaff wrote:
> So, at this point, with libwebkit-1.0-1 and libwebkit-dev installed (on 
> kubuntu), I can replace use of gtkhtml by webkit.
Excellent!

Would it also be possible to include the option for a report to return a 
simple HTML string rather than a gnc document?  My new-fangled 
eguile-based reports (see 
http://bugzilla.gnome.org/show_bug.cgi?id=574582) create such an HTML 
string, and then convert it to a gnc document, and then it gets 
converted straight back again.

In fact I think all that is required to achieve this is the following 
patch (which I've edited to avoid wrapping, but you get the gist):

Index: report.scm
===================================================================
--- report.scm	(revision 18001)
+++ report.scm	(working copy)
@@ -633,8 +633,11 @@
               (stylesheet (gnc:report-stylesheet report))
               (doc (renderer report))
               (html #f))
-        (gnc:html-document-set-style-sheet! doc stylesheet)
-        (set! html (gnc:html-document-render doc headers?))
+        (if (string? doc)
+          (set! html doc)
+          (begin
+            (gnc:html-document-set-style-sheet! doc stylesheet)
+            (set! html (gnc:html-document-render doc headers?))))
          (gnc:report-set-ctext! report html) ;; cache the html
          (gnc:report-set-dirty?! report #f)  ;; mark it clean
          html)

cheers

Chris
-- 
Chris Dennis                                  cgdennis at btinternet.com
Fordingbridge, Hampshire, UK


More information about the gnucash-devel mailing list