Bug #626403: Fix inconsistent formatting between stylesheets (Webkit vs. gtkhtml)

Patch by Alex Aycinena:

The 'default' stylesheet formats the balance sheet, cash flow, income statement
and transaction reports properly under webkit but not under gtkhtml.

The 'easy', 'footer', and 'technicolor' stylesheets are the reverse; that is,
they format the balance sheet, cash flow, income statement and transaction
reports properly under gtkhtml but not under webkit, except that the 'footer'
stylesheet also has some formatting problems with gtkhtml as well.

The attached patch file corrects these problems. Specifically:

- styles that are missing in the 'footer' stylesheet (compared to 'easy') are
added

- the function 'gnc-html-engine-supports-css' is used in the 'default', 'easy',
'footer' and 'technicolor' stylesheets to provide styles for either webkit or
gtkhtml

- the taxtxf.scm report file is simplified to take advantage of these changes

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19428 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2010-08-14 20:14:37 +00:00
parent 0c41000c7a
commit 0d9917127f
5 changed files with 607 additions and 328 deletions

View File

@ -434,14 +434,11 @@
'attribute (list "cellspacing" "0")
'attribute (list "cellpadding" "0")
'attribute (list "width" "100%"))
(let ((total-amnt (if (gnc-html-engine-supports-css)
(if total-amount-neg?
(gnc:make-html-table-cell/markup
"number-cell-bot-neg" total)
(gnc:make-html-table-cell/markup
"number-cell-bot" total))
(let ((total-amnt (if total-amount-neg?
(gnc:make-html-table-cell/markup
"number-cell-bot" total)))
"number-cell-bot-neg" total)
(gnc:make-html-table-cell/markup
"number-cell-bot" total)))
)
(gnc:html-table-append-row! amount-table total-amnt)
)
@ -808,13 +805,10 @@
tran-split
splt-print-amnt))
(splt-amnt-anchor
(if (gnc-html-engine-supports-css)
(if (gnc-numeric-negative-p splt-print-amnt)
(gnc:make-html-table-cell/markup
"number-cell-bot-neg" splt-amnt-anchor)
(gnc:make-html-table-cell/markup
"number-cell-bot" splt-amnt-anchor))
(gnc:make-html-table-cell/markup
(if (gnc-numeric-negative-p splt-print-amnt)
(gnc:make-html-table-cell/markup
"number-cell-bot-neg" splt-amnt-anchor)
(gnc:make-html-table-cell/markup
"number-cell-bot" splt-amnt-anchor)))
)
(gnc:html-table-append-row!
@ -842,17 +836,11 @@
(let* ((plug-amnt (gnc-numeric-add-fixed print-amnt
(gnc-numeric-neg
trans-rpt-currency-total)))
(plug-amnt (if (gnc-html-engine-supports-css)
(if (gnc-numeric-negative-p plug-amnt)
(gnc:make-html-table-cell/markup
"number-cell-bot-neg"
plug-amnt)
(gnc:make-html-table-cell/markup
"number-cell-bot"
plug-amnt))
(plug-amnt (if (gnc-numeric-negative-p plug-amnt)
(gnc:make-html-table-cell/markup
"number-cell-bot"
plug-amnt)))
"number-cell-bot-neg" plug-amnt)
(gnc:make-html-table-cell/markup
"number-cell-bot" plug-amnt)))
)
(gnc:html-table-append-row! transfer-table
(append
@ -1036,17 +1024,13 @@
'attribute (list "cellpadding" "0")
'attribute (list "width" "100%"))
(let ((beg-bal-amnt
(if (gnc-html-engine-supports-css)
(if beg-bal-neg?
(gnc:make-html-table-cell/markup
(if beg-bal-neg?
(gnc:make-html-table-cell/markup
"number-cell-bot-neg"
account-beg-amnt)
(gnc:make-html-table-cell/markup
"number-cell-bot"
account-beg-amnt))
(gnc:make-html-table-cell/markup
"number-cell-bot"
account-beg-amnt)))
"number-cell-bot"
account-beg-amnt)))
)
(gnc:html-table-append-row!
amount-table beg-bal-amnt)
@ -1283,14 +1267,11 @@
(let* ((splt-amnt-anchor (gnc:html-split-anchor
split print-amnt))
(splt-amnt-anchor
(if (gnc-html-engine-supports-css)
(if (gnc-numeric-negative-p print-amnt)
(gnc:make-html-table-cell/markup
"number-cell-bot-neg" splt-amnt-anchor)
(gnc:make-html-table-cell/markup
"number-cell-bot" splt-amnt-anchor))
(if (gnc-numeric-negative-p print-amnt)
(gnc:make-html-table-cell/markup
"number-cell-bot" splt-amnt-anchor)))
"number-cell-bot-neg" splt-amnt-anchor)
(gnc:make-html-table-cell/markup
"number-cell-bot" splt-amnt-anchor)))
)
(gnc:html-table-append-row!
amount-table splt-amnt-anchor)
@ -2632,107 +2613,42 @@
#f) ;;end of if
(begin ; else do tax report
(if (gnc-html-engine-supports-css)
(if (eq? selected-style-sheet 'Default)
(begin ;; this is for webkit: default
(gnc:html-document-set-style!
doc "header-just-top"
'tag "th"
'attribute (list "class" "column-heading-left")
'attribute (list "valign" "top"))
(begin ;; this is for webkit
(gnc:html-document-set-style!
doc "header-just-top"
'tag "th"
'attribute (list "class" "column-heading-left")
'attribute (list "valign" "top"))
(gnc:html-document-set-style!
doc "header-just-bot"
'tag "th"
'attribute (list "class" "column-heading-left")
'attribute (list "valign" "bottom"))
(gnc:html-document-set-style!
doc "header-just-bot"
'tag "th"
'attribute (list "class" "column-heading-left")
'attribute (list "valign" "bottom"))
(gnc:html-document-set-style!
doc "tran-detail"
'tag "tr"
'attribute (list "class" "normal-row")
'attribute (list "valign" "top"))
(gnc:html-document-set-style!
doc "tran-detail"
'tag "tr"
'attribute (list "class" "normal-row")
'attribute (list "valign" "top"))
(gnc:html-document-set-style!
doc "tran-detail-shade"
'tag "tr"
'attribute (list "class" "alternate-row")
'attribute (list "valign" "top"))
(gnc:html-document-set-style!
doc "tran-detail-shade"
'tag "tr"
'attribute (list "class" "alternate-row")
'attribute (list "valign" "top"))
(gnc:html-document-set-style!
doc "number-cell-bot"
'tag "td"
'attribute (list "class" "number-cell")
'attribute (list "valign" "bottom"))
(gnc:html-document-set-style!
doc "number-cell-bot"
'tag "td"
'attribute (list "class" "number-cell")
'attribute (list "valign" "bottom"))
(gnc:html-document-set-style!
doc "number-cell-bot-neg"
'tag "td"
'attribute (list "class" "number-cell neg")
'attribute (list "valign" "bottom"))
(gnc:html-document-set-style!
doc "just-bot"
'tag "td"
'attribute (list "valign" "bottom"))
)
(begin ;; this is for webkit: easy, footer, technicolor
(gnc:html-document-set-style!
doc "header-just-top"
'tag "th"
'attribute (list "class" "column-heading-left")
'attribute (list "valign" "top"))
(gnc:html-document-set-style!
doc "header-just-bot"
'tag "th"
'attribute (list "class" "column-heading-left")
'attribute (list "valign" "bottom"))
(gnc:html-document-set-style!
doc "column-heading-center"
'tag "th"
'attribute (list "class" "column-heading-center")
'attribute (list "valign" "bottom"))
(gnc:html-document-set-style!
doc "column-heading-right"
'tag "th"
'attribute (list "class" "column-heading-right")
'attribute (list "valign" "bottom"))
(gnc:html-document-set-style!
doc "tran-detail"
'tag "tr"
'attribute (list "valign" "top"))
(gnc:html-document-set-style!
doc "tran-detail-shade"
'tag "tr"
'attribute (list "class" "alternate-row")
'attribute (list "valign" "top"))
(gnc:html-document-set-style!
doc "date-cell"
'tag "td"
'attribute (list "class" "date-cell"))
(gnc:html-document-set-style!
doc "number-cell-bot"
'tag "td"
'attribute (list "class" "number-cell")
'attribute (list "valign" "bottom"))
(gnc:html-document-set-style!
doc "number-cell-bot-neg"
'tag "td"
'attribute (list "class" "number-cell neg")
'attribute (list "valign" "bottom"))
(gnc:html-document-set-style!
doc "just-bot"
'tag "td"
'attribute (list "valign" "bottom"))
)
(gnc:html-document-set-style!
doc "number-cell-bot-neg"
'tag "td"
'attribute (list "class" "number-cell neg")
'attribute (list "valign" "bottom"))
)
(begin ;; this is for gtkhtml
(gnc:html-document-set-style!
@ -2776,17 +2692,24 @@
'attribute (list "nowrap" "nowrap")
'attribute (list "valign" "bottom"))
(gnc:html-document-set-style!
doc "number-cell-bot-neg"
'tag "td"
'attribute (list "align" "right")
'attribute (list "nowrap" "nowrap")
'attribute (list "valign" "bottom"))
(gnc:html-document-set-style!
doc "date-cell"
'tag "td"
'attribute (list "nowrap" "nowrap"))
(gnc:html-document-set-style!
doc "just-bot"
'tag "td"
'attribute (list "valign" "bottom"))
))
(gnc:html-document-set-style!
doc "just-bot"
'tag "td"
'attribute (list "valign" "bottom"))
(gnc:html-document-set-title! doc report-name)
(gnc:html-document-add-object!

View File

@ -32,6 +32,7 @@
(use-modules (gnucash main)) ;; FIXME: delete after we finish modularizing.
(use-modules (gnucash gnc-module))
(gnc:module-load "gnucash/html" 0) ; added for 'gnc-html-engine-supports-css'
(gnc:module-load "gnucash/report/report-system" 0)
(define (easy-options)
@ -60,7 +61,7 @@
(opt-register
(gnc:make-simple-boolean-option
(N_ "General")
(N_ "Enable Links") "c"
(N_ "Enable Links") "d"
(N_ "Enable hyperlinks in reports")
#t))
@ -164,7 +165,7 @@
(opt-register
(gnc:make-number-range-option
(N_ "Tables")
(N_ "Table cell padding") "b" (N_ "Space between table cells")
(N_ "Table cell padding") "b" (N_ "Space between table cell edge and content")
1 0 20 0 1))
(opt-register
@ -225,31 +226,143 @@
;;;;
;;;;
;;;;
(gnc:html-document-set-style!
ssdoc "number-header"
'tag "th"
'attribute (list "align" "right"))
;;;;
;;;;
;;;;
(if (gnc-html-engine-supports-css)
(begin ;; this is for webkit
(gnc:html-document-set-style!
ssdoc "column-heading-left"
'tag "th"
'attribute (list "class" "column-heading-left"))
(gnc:html-document-set-style!
ssdoc "anchor-cell"
'tag "td"
'attribute (list "align" "left")
'attribute (list "nowrap"))
(gnc:html-document-set-style!
ssdoc "column-heading-center"
'tag "th"
'attribute (list "class" "column-heading-center"))
(gnc:html-document-set-style!
ssdoc "number-cell"
'tag "td"
'attribute (list "align" "right")
'attribute (list "nowrap"))
(gnc:html-document-set-style!
ssdoc "column-heading-right"
'tag "th"
'attribute (list "class" "column-heading-right"))
(gnc:html-document-set-style!
ssdoc "number-cell-neg"
'tag "td"
'attribute (list "align" "right")
'attribute (list "nowrap"))
(gnc:html-document-set-style!
ssdoc "date-cell"
'tag "td"
'attribute (list "class" "date-cell"))
(gnc:html-document-set-style!
ssdoc "anchor-cell"
'tag "td"
'attribute (list "class" "anchor-cell"))
(gnc:html-document-set-style!
ssdoc "number-cell"
'tag "td"
'attribute (list "class" "number-cell"))
(gnc:html-document-set-style!
ssdoc "number-cell-neg"
'tag "td"
'attribute (list "class" "number-cell neg"))
(gnc:html-document-set-style!
ssdoc "number-header"
'tag "th"
'attribute (list "class" "number-header"))
(gnc:html-document-set-style!
ssdoc "text-cell"
'tag "td"
'attribute (list "class" "text-cell"))
(gnc:html-document-set-style!
ssdoc "total-number-cell"
'tag '("td" "b")
'attribute (list "class" "total-number-cell"))
(gnc:html-document-set-style!
ssdoc "total-number-cell-neg"
'tag '("td" "b")
'attribute (list "class" "total-number-cell neg"))
(gnc:html-document-set-style!
ssdoc "total-label-cell"
'tag '("td" "b")
'attribute (list "class" "total-label-cell"))
(gnc:html-document-set-style!
ssdoc "centered-label-cell"
'tag '("td" "b")
'attribute (list "class" "centered-label-cell"))
)
(begin ;; this is for gtkhtml
(gnc:html-document-set-style!
ssdoc "column-heading-left"
'tag "th"
'attribute (list "align" "left"))
(gnc:html-document-set-style!
ssdoc "column-heading-center"
'tag "th"
'attribute (list "align" "center"))
(gnc:html-document-set-style!
ssdoc "column-heading-right"
'tag "th"
'attribute (list "align" "right"))
(gnc:html-document-set-style!
ssdoc "date-cell"
'tag "td"
'attribute (list "nowrap" "nowrap"))
(gnc:html-document-set-style!
ssdoc "anchor-cell"
'tag "td"
'attribute (list "align" "left")
'attribute (list "nowrap"))
(gnc:html-document-set-style!
ssdoc "number-cell"
'tag "td"
'attribute (list "align" "right")
'attribute (list "nowrap"))
(gnc:html-document-set-style!
ssdoc "number-cell-neg"
'tag "td"
'attribute (list "align" "right")
'attribute (list "nowrap"))
(gnc:html-document-set-style!
ssdoc "number-header"
'tag "th"
'attribute (list "align" "right"))
(gnc:html-document-set-style!
ssdoc "text-cell"
'tag "td"
'attribute (list "align" "left"))
(gnc:html-document-set-style!
ssdoc "total-number-cell"
'tag '("td" "b")
'attribute (list "align" "right"))
(gnc:html-document-set-style!
ssdoc "total-number-cell-neg"
'tag '("td" "b")
'attribute (list "align" "right"))
(gnc:html-document-set-style!
ssdoc "total-label-cell"
'tag '("td" "b")
'attribute (list "align" "left"))
(gnc:html-document-set-style!
ssdoc "centered-label-cell"
'tag '("td" "b")
'attribute (list "align" "center"))
)
)
(if (and bgpixmap
(not (string=? bgpixmap "")))
@ -284,31 +397,6 @@
'attribute (list "bgcolor" grand-total-color)
'tag "tr")
(gnc:html-document-set-style!
ssdoc "text-cell"
'tag "td"
'attribute (list "align" "left"))
(gnc:html-document-set-style!
ssdoc "total-number-cell"
'tag '("td" "b")
'attribute (list "align" "right"))
(gnc:html-document-set-style!
ssdoc "total-number-cell-neg"
'tag '("td" "b")
'attribute (list "align" "right"))
(gnc:html-document-set-style!
ssdoc "total-label-cell"
'tag '("td" "b")
'attribute (list "align" "left"))
(gnc:html-document-set-style!
ssdoc "centered-label-cell"
'tag '("td" "b")
'attribute (list "align" "center"))
;; don't surround marked-up links with <a> </a>
(if (not links?)
(gnc:html-document-set-style!

View File

@ -26,6 +26,7 @@
(use-modules (gnucash main)) ;; FIXME: delete after we finish modularizing.
(use-modules (gnucash gnc-module))
(gnc:module-load "gnucash/html" 0) ; added for 'gnc-html-engine-supports-css'
(gnc:module-load "gnucash/report/report-system" 0)
(define (fancy-options)
@ -54,7 +55,7 @@
(opt-register
(gnc:make-simple-boolean-option
(N_ "General")
(N_ "Enable Links") "c"
(N_ "Enable Links") "d"
(N_ "Enable hyperlinks in reports")
#t))
@ -158,7 +159,7 @@
(opt-register
(gnc:make-number-range-option
(N_ "Tables")
(N_ "Table cell padding") "b" (N_ "Space between table cells")
(N_ "Table cell padding") "b" (N_ "Space between table cell edge and content")
1 0 20 0 1))
(opt-register
@ -220,30 +221,143 @@
;;;;
;;;;
;;;;
(gnc:html-document-set-style!
ssdoc "number-header"
'tag "th"
'attribute (list "align" "right"))
;;;;
;;;;
;;;;
(gnc:html-document-set-style!
ssdoc "anchor-cell"
'tag "td"
'attribute (list "align" "left")
'attribute (list "nowrap"))
(if (gnc-html-engine-supports-css)
(begin ;; this is for webkit
(gnc:html-document-set-style!
ssdoc "column-heading-left"
'tag "th"
'attribute (list "class" "column-heading-left"))
(gnc:html-document-set-style!
ssdoc "number-cell"
'tag "td"
'attribute (list "align" "right")
'attribute (list "nowrap"))
(gnc:html-document-set-style!
ssdoc "column-heading-center"
'tag "th"
'attribute (list "class" "column-heading-center"))
(gnc:html-document-set-style!
ssdoc "number-cell-neg"
'tag "td"
'attribute (list "align" "right")
'attribute (list "nowrap"))
(gnc:html-document-set-style!
ssdoc "column-heading-right"
'tag "th"
'attribute (list "class" "column-heading-right"))
(gnc:html-document-set-style!
ssdoc "date-cell"
'tag "td"
'attribute (list "class" "date-cell"))
(gnc:html-document-set-style!
ssdoc "anchor-cell"
'tag "td"
'attribute (list "class" "anchor-cell"))
(gnc:html-document-set-style!
ssdoc "number-cell"
'tag "td"
'attribute (list "class" "number-cell"))
(gnc:html-document-set-style!
ssdoc "number-cell-neg"
'tag "td"
'attribute (list "class" "number-cell neg"))
(gnc:html-document-set-style!
ssdoc "number-header"
'tag "th"
'attribute (list "class" "number-header"))
(gnc:html-document-set-style!
ssdoc "text-cell"
'tag "td"
'attribute (list "class" "text-cell"))
(gnc:html-document-set-style!
ssdoc "total-number-cell"
'tag '("td" "b")
'attribute (list "class" "total-number-cell"))
(gnc:html-document-set-style!
ssdoc "total-number-cell-neg"
'tag '("td" "b")
'attribute (list "class" "total-number-cell neg"))
(gnc:html-document-set-style!
ssdoc "total-label-cell"
'tag '("td" "b")
'attribute (list "class" "total-label-cell"))
(gnc:html-document-set-style!
ssdoc "centered-label-cell"
'tag '("td" "b")
'attribute (list "class" "centered-label-cell"))
)
(begin ;; this is for gtkhtml
(gnc:html-document-set-style!
ssdoc "column-heading-left"
'tag "th"
'attribute (list "align" "left"))
(gnc:html-document-set-style!
ssdoc "column-heading-center"
'tag "th"
'attribute (list "align" "center"))
(gnc:html-document-set-style!
ssdoc "column-heading-right"
'tag "th"
'attribute (list "align" "right"))
(gnc:html-document-set-style!
ssdoc "date-cell"
'tag "td"
'attribute (list "nowrap" "nowrap"))
(gnc:html-document-set-style!
ssdoc "anchor-cell"
'tag "td"
'attribute (list "align" "left")
'attribute (list "nowrap"))
(gnc:html-document-set-style!
ssdoc "number-cell"
'tag "td"
'attribute (list "align" "right")
'attribute (list "nowrap"))
(gnc:html-document-set-style!
ssdoc "number-cell-neg"
'tag "td"
'attribute (list "align" "right")
'attribute (list "nowrap"))
(gnc:html-document-set-style!
ssdoc "number-header"
'tag "th"
'attribute (list "align" "right"))
(gnc:html-document-set-style!
ssdoc "text-cell"
'tag "td"
'attribute (list "align" "left"))
(gnc:html-document-set-style!
ssdoc "total-number-cell"
'tag '("td" "b")
'attribute (list "align" "right"))
(gnc:html-document-set-style!
ssdoc "total-number-cell-neg"
'tag '("td" "b")
'attribute (list "align" "right"))
(gnc:html-document-set-style!
ssdoc "total-label-cell"
'tag '("td" "b")
'attribute (list "align" "left"))
(gnc:html-document-set-style!
ssdoc "centered-label-cell"
'tag '("td" "b")
'attribute (list "align" "center"))
)
)
(if (and bgpixmap
(not (string=? bgpixmap "")))
@ -278,31 +392,6 @@
'attribute (list "bgcolor" grand-total-color)
'tag "tr")
(gnc:html-document-set-style!
ssdoc "text-cell"
'tag "td"
'attribute (list "align" "left"))
(gnc:html-document-set-style!
ssdoc "total-number-cell"
'tag '("td" "b")
'attribute (list "align" "right"))
(gnc:html-document-set-style!
ssdoc "total-number-cell-neg"
'tag '("td" "b")
'attribute (list "align" "right"))
(gnc:html-document-set-style!
ssdoc "total-label-cell"
'tag '("td" "b")
'attribute (list "align" "left"))
(gnc:html-document-set-style!
ssdoc "centered-label-cell"
'tag '("td" "b")
'attribute (list "align" "center"))
;; don't surround marked-up links with <a> </a>
(if (not links?)
(gnc:html-document-set-style!

View File

@ -37,6 +37,7 @@
(use-modules (gnucash main)) ;; FIXME: delete after we finish modularizing.
(use-modules (gnucash gnc-module))
(gnc:module-load "gnucash/html" 0) ; added for 'gnc-html-engine-supports-css'
(gnc:module-load "gnucash/report/report-system" 0)
(define (footer-options)
@ -177,7 +178,7 @@
(opt-register
(gnc:make-number-range-option
(N_ "Tables")
(N_ "Table cell padding") "b" (N_ "Space between table cells")
(N_ "Table cell padding") "b" (N_ "Space between table cell edge and content")
1 0 20 0 1))
(opt-register
@ -239,19 +240,143 @@
;;;;
;;;;
;;;;
(gnc:html-document-set-style!
ssdoc "number-header"
'tag "th"
'attribute (list "align" "right"))
;;;;
;;;;
;;;;
(if (gnc-html-engine-supports-css)
(begin ;; this is for webkit
(gnc:html-document-set-style!
ssdoc "column-heading-left"
'tag "th"
'attribute (list "class" "column-heading-left"))
(gnc:html-document-set-style!
ssdoc "number-cell"
'tag "td"
'attribute (list "align" "right")
'attribute (list "nowrap"))
(gnc:html-document-set-style!
ssdoc "column-heading-center"
'tag "th"
'attribute (list "class" "column-heading-center"))
(gnc:html-document-set-style!
ssdoc "column-heading-right"
'tag "th"
'attribute (list "class" "column-heading-right"))
(gnc:html-document-set-style!
ssdoc "date-cell"
'tag "td"
'attribute (list "class" "date-cell"))
(gnc:html-document-set-style!
ssdoc "anchor-cell"
'tag "td"
'attribute (list "class" "anchor-cell"))
(gnc:html-document-set-style!
ssdoc "number-cell"
'tag "td"
'attribute (list "class" "number-cell"))
(gnc:html-document-set-style!
ssdoc "number-cell-neg"
'tag "td"
'attribute (list "class" "number-cell neg"))
(gnc:html-document-set-style!
ssdoc "number-header"
'tag "th"
'attribute (list "class" "number-header"))
(gnc:html-document-set-style!
ssdoc "text-cell"
'tag "td"
'attribute (list "class" "text-cell"))
(gnc:html-document-set-style!
ssdoc "total-number-cell"
'tag '("td" "b")
'attribute (list "class" "total-number-cell"))
(gnc:html-document-set-style!
ssdoc "total-number-cell-neg"
'tag '("td" "b")
'attribute (list "class" "total-number-cell neg"))
(gnc:html-document-set-style!
ssdoc "total-label-cell"
'tag '("td" "b")
'attribute (list "class" "total-label-cell"))
(gnc:html-document-set-style!
ssdoc "centered-label-cell"
'tag '("td" "b")
'attribute (list "class" "centered-label-cell"))
)
(begin ;; this is for gtkhtml
(gnc:html-document-set-style!
ssdoc "column-heading-left"
'tag "th"
'attribute (list "align" "left"))
(gnc:html-document-set-style!
ssdoc "column-heading-center"
'tag "th"
'attribute (list "align" "center"))
(gnc:html-document-set-style!
ssdoc "column-heading-right"
'tag "th"
'attribute (list "align" "right"))
(gnc:html-document-set-style!
ssdoc "date-cell"
'tag "td"
'attribute (list "nowrap" "nowrap"))
(gnc:html-document-set-style!
ssdoc "anchor-cell"
'tag "td"
'attribute (list "align" "left")
'attribute (list "nowrap"))
(gnc:html-document-set-style!
ssdoc "number-cell"
'tag "td"
'attribute (list "align" "right")
'attribute (list "nowrap"))
(gnc:html-document-set-style!
ssdoc "number-cell-neg"
'tag "td"
'attribute (list "align" "right")
'attribute (list "nowrap"))
(gnc:html-document-set-style!
ssdoc "number-header"
'tag "th"
'attribute (list "align" "right"))
(gnc:html-document-set-style!
ssdoc "text-cell"
'tag "td"
'attribute (list "align" "left"))
(gnc:html-document-set-style!
ssdoc "total-number-cell"
'tag '("td" "b")
'attribute (list "align" "right"))
(gnc:html-document-set-style!
ssdoc "total-number-cell-neg"
'tag '("td" "b")
'attribute (list "align" "right"))
(gnc:html-document-set-style!
ssdoc "total-label-cell"
'tag '("td" "b")
'attribute (list "align" "left"))
(gnc:html-document-set-style!
ssdoc "centered-label-cell"
'tag '("td" "b")
'attribute (list "align" "center"))
)
)
(if (and bgpixmap
(not (string=? bgpixmap "")))
@ -286,26 +411,6 @@
'attribute (list "bgcolor" grand-total-color)
'tag "tr")
(gnc:html-document-set-style!
ssdoc "text-cell"
'tag "td"
'attribute (list "align" "left"))
(gnc:html-document-set-style!
ssdoc "total-number-cell"
'tag '("td" "b")
'attribute (list "align" "right"))
(gnc:html-document-set-style!
ssdoc "total-label-cell"
'tag '("td" "b")
'attribute (list "align" "left"))
(gnc:html-document-set-style!
ssdoc "centered-label-cell"
'tag '("td" "b")
'attribute (list "align" "center"))
;; don't surround marked-up links with <a> </a>
(if (not links?)
(gnc:html-document-set-style! ssdoc "a" 'tag ""))
@ -358,7 +463,7 @@
(gnc:html-table-set-cell!
t 0 0
(gnc:make-html-text
(gnc:html-markup-img logopixmap)))))
(gnc:html-markup-img (make-file-url logopixmap))))))
(if (and headpixmap (> (string-length headpixmap) 0))
(begin
@ -367,7 +472,7 @@
(gnc:make-html-text
(string-append
"<div align=\"" align "\">"
"<img src=\"" headpixmap "\">"
"<img src=\"" (make-file-url headpixmap) "\">"
"</div>")))
)
(gnc:html-table-set-cell!
@ -383,8 +488,8 @@
; I think this is the correct place to put the footer
(gnc:html-table-set-cell!
t 3 headcolumn
(gnc:make-html-text footer-text))
ssdoc)))
(gnc:make-html-text footer-text)))
ssdoc))
(gnc:define-html-style-sheet
'version 1

View File

@ -31,6 +31,7 @@
(use-modules (srfi srfi-13))
(use-modules (srfi srfi-14))
(gnc:module-load "gnucash/html" 0) ; added for 'gnc-html-engine-supports-css'
(gnc:module-load "gnucash/report/report-system" 0)
;; plain style sheet
@ -71,7 +72,7 @@
(opt-register
(gnc:make-number-range-option
(N_ "Tables")
(N_ "Table cell padding") "b" (N_ "Space between table cell edge and cell content")
(N_ "Table cell padding") "b" (N_ "Space between table cell edge and content")
4 0 20 0 1))
(opt-register
(gnc:make-number-range-option
@ -122,70 +123,143 @@
'attribute (list "cellspacing" spacing)
'attribute (list "cellpadding" padding))
(gnc:html-document-set-style!
ssdoc "date-cell"
'tag "td"
'attribute (list "class" "date-cell"))
(if (gnc-html-engine-supports-css)
(begin ;; this is for webkit
(gnc:html-document-set-style!
ssdoc "column-heading-left"
'tag "th"
'attribute (list "class" "column-heading-left"))
(gnc:html-document-set-style!
ssdoc "column-heading-left"
'tag "th"
'attribute (list "class" "column-heading-left"))
(gnc:html-document-set-style!
ssdoc "column-heading-center"
'tag "th"
'attribute (list "class" "column-heading-center"))
(gnc:html-document-set-style!
ssdoc "column-heading-center"
'tag "th"
'attribute (list "class" "column-heading-center"))
(gnc:html-document-set-style!
ssdoc "column-heading-right"
'tag "th"
'attribute (list "class" "column-heading-right"))
(gnc:html-document-set-style!
ssdoc "column-heading-right"
'tag "th"
'attribute (list "class" "column-heading-right"))
(gnc:html-document-set-style!
ssdoc "date-cell"
'tag "td"
'attribute (list "class" "date-cell"))
(gnc:html-document-set-style!
ssdoc "anchor-cell"
'tag "td"
'attribute (list "class" "anchor-cell"))
(gnc:html-document-set-style!
ssdoc "anchor-cell"
'tag "td"
'attribute (list "class" "anchor-cell"))
(gnc:html-document-set-style!
ssdoc "number-cell"
'tag "td"
'attribute (list "class" "number-cell"))
(gnc:html-document-set-style!
ssdoc "number-cell"
'tag "td"
'attribute (list "class" "number-cell"))
(gnc:html-document-set-style!
ssdoc "number-cell-neg"
'tag "td"
'attribute (list "class" "number-cell neg"))
(gnc:html-document-set-style!
ssdoc "number-cell-neg"
'tag "td"
'attribute (list "class" "number-cell neg"))
(gnc:html-document-set-style!
ssdoc "number-header"
'tag "th"
'attribute (list "class" "number-header"))
(gnc:html-document-set-style!
ssdoc "number-header"
'tag "th"
'attribute (list "class" "number-header"))
(gnc:html-document-set-style!
ssdoc "text-cell"
'tag "td"
'attribute (list "class" "text-cell"))
(gnc:html-document-set-style!
ssdoc "text-cell"
'tag "td"
'attribute (list "class" "text-cell"))
(gnc:html-document-set-style!
ssdoc "total-number-cell"
'tag "td"
'attribute (list "class" "total-number-cell"))
(gnc:html-document-set-style!
ssdoc "total-number-cell"
'tag "td"
'attribute (list "class" "total-number-cell"))
(gnc:html-document-set-style!
ssdoc "total-number-cell-neg"
'tag "td"
'attribute (list "class" "total-number-cell neg"))
(gnc:html-document-set-style!
ssdoc "total-number-cell-neg"
'tag "td"
'attribute (list "class" "total-number-cell neg"))
(gnc:html-document-set-style!
ssdoc "total-label-cell"
'tag "td"
'attribute (list "class" "total-label-cell"))
(gnc:html-document-set-style!
ssdoc "total-label-cell"
'tag "td"
'attribute (list "class" "total-label-cell"))
(gnc:html-document-set-style!
ssdoc "centered-label-cell"
'tag "td"
'attribute (list "class" "centered-label-cell"))
(gnc:html-document-set-style!
ssdoc "centered-label-cell"
'tag "td"
'attribute (list "class" "centered-label-cell"))
)
(begin ;; this is for gtkhtml
(gnc:html-document-set-style!
ssdoc "column-heading-left"
'tag "th"
'attribute (list "align" "left"))
(gnc:html-document-set-style!
ssdoc "column-heading-center"
'tag "th"
'attribute (list "align" "center"))
(gnc:html-document-set-style!
ssdoc "column-heading-right"
'tag "th"
'attribute (list "align" "right"))
(gnc:html-document-set-style!
ssdoc "date-cell"
'tag "td"
'attribute (list "nowrap" "nowrap"))
(gnc:html-document-set-style!
ssdoc "anchor-cell"
'tag "td"
'attribute (list "align" "left")
'attribute (list "nowrap"))
(gnc:html-document-set-style!
ssdoc "number-cell"
'tag "td"
'attribute (list "align" "right")
'attribute (list "nowrap"))
(gnc:html-document-set-style!
ssdoc "number-cell-neg"
'tag "td"
'attribute (list "align" "right")
'attribute (list "nowrap"))
(gnc:html-document-set-style!
ssdoc "number-header"
'tag "th"
'attribute (list "align" "right"))
(gnc:html-document-set-style!
ssdoc "text-cell"
'tag "td"
'attribute (list "align" "left"))
(gnc:html-document-set-style!
ssdoc "total-number-cell"
'tag "td"
'attribute (list "align" "right"))
(gnc:html-document-set-style!
ssdoc "total-number-cell-neg"
'tag "td"
'attribute (list "align" "right"))
(gnc:html-document-set-style!
ssdoc "total-label-cell"
'tag "td"
'attribute (list "align" "left"))
(gnc:html-document-set-style!
ssdoc "centered-label-cell"
'tag "td"
'attribute (list "align" "center"))
)
)
(gnc:html-document-set-style!
ssdoc "normal-row"