r19428 - gnucash/trunk/src/report - Bug #626403: Fix inconsistent formatting between stylesheets (Webkit vs. gtkhtml)
Christian Stimming
cstim at code.gnucash.org
Sat Aug 14 16:14:37 EDT 2010
Author: cstim
Date: 2010-08-14 16:14:37 -0400 (Sat, 14 Aug 2010)
New Revision: 19428
Trac: http://svn.gnucash.org/trac/changeset/19428
Modified:
gnucash/trunk/src/report/locale-specific/us/taxtxf.scm
gnucash/trunk/src/report/stylesheets/stylesheet-easy.scm
gnucash/trunk/src/report/stylesheets/stylesheet-fancy.scm
gnucash/trunk/src/report/stylesheets/stylesheet-footer.scm
gnucash/trunk/src/report/stylesheets/stylesheet-plain.scm
Log:
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
Modified: gnucash/trunk/src/report/locale-specific/us/taxtxf.scm
===================================================================
--- gnucash/trunk/src/report/locale-specific/us/taxtxf.scm 2010-08-14 20:11:23 UTC (rev 19427)
+++ gnucash/trunk/src/report/locale-specific/us/taxtxf.scm 2010-08-14 20:14:37 UTC (rev 19428)
@@ -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
+ (let ((total-amnt (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))
(gnc:make-html-table-cell/markup
- "number-cell-bot" total)))
+ "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
+ (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))
(gnc:make-html-table-cell/markup
- "number-cell-bot" splt-amnt-anchor)))
+ "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!
@@ -2777,16 +2693,23 @@
'attribute (list "valign" "bottom"))
(gnc:html-document-set-style!
- doc "date-cell"
+ doc "number-cell-bot-neg"
'tag "td"
- 'attribute (list "nowrap" "nowrap"))
+ 'attribute (list "align" "right")
+ 'attribute (list "nowrap" "nowrap")
+ 'attribute (list "valign" "bottom"))
(gnc:html-document-set-style!
- doc "just-bot"
+ doc "date-cell"
'tag "td"
- 'attribute (list "valign" "bottom"))
+ 'attribute (list "nowrap" "nowrap"))
))
+ (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!
Modified: gnucash/trunk/src/report/stylesheets/stylesheet-easy.scm
===================================================================
--- gnucash/trunk/src/report/stylesheets/stylesheet-easy.scm 2010-08-14 20:11:23 UTC (rev 19427)
+++ gnucash/trunk/src/report/stylesheets/stylesheet-easy.scm 2010-08-14 20:14:37 UTC (rev 19428)
@@ -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,32 +226,144 @@
;;;;
;;;;
;;;;
- (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 "")))
(gnc:html-document-set-style!
@@ -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!
Modified: gnucash/trunk/src/report/stylesheets/stylesheet-fancy.scm
===================================================================
--- gnucash/trunk/src/report/stylesheets/stylesheet-fancy.scm 2010-08-14 20:11:23 UTC (rev 19427)
+++ gnucash/trunk/src/report/stylesheets/stylesheet-fancy.scm 2010-08-14 20:14:37 UTC (rev 19428)
@@ -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,31 +221,144 @@
;;;;
;;;;
;;;;
- (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 "")))
(gnc:html-document-set-style!
@@ -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!
Modified: gnucash/trunk/src/report/stylesheets/stylesheet-footer.scm
===================================================================
--- gnucash/trunk/src/report/stylesheets/stylesheet-footer.scm 2010-08-14 20:11:23 UTC (rev 19427)
+++ gnucash/trunk/src/report/stylesheets/stylesheet-footer.scm 2010-08-14 20:14:37 UTC (rev 19428)
@@ -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,20 +240,144 @@
;;;;
;;;;
;;;;
- (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 "")))
(gnc:html-document-set-style!
@@ -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
Modified: gnucash/trunk/src/report/stylesheets/stylesheet-plain.scm
===================================================================
--- gnucash/trunk/src/report/stylesheets/stylesheet-plain.scm 2010-08-14 20:11:23 UTC (rev 19427)
+++ gnucash/trunk/src/report/stylesheets/stylesheet-plain.scm 2010-08-14 20:14:37 UTC (rev 19428)
@@ -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,71 +123,144 @@
'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"
'tag "tr")
More information about the gnucash-changes
mailing list