Skip to content

Commit 24fd299

Browse files
authored
Merge pull request #207 from fugerit-org/206-fj-doc-mod-fop-element-table-space-after-and-space-before-are-not-handled
206 fj doc mod fop element table space after and space before are not handled
2 parents 95546b1 + 7737210 commit 24fd299

File tree

6 files changed

+15
-6
lines changed

6 files changed

+15
-6
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Changed
1111

1212
- [fj-doc-playground-quarkus] quarkus version set to 3.15.0
13+
- [fj-doc-maven-plugin] goal init, flavour springboot-3, default springboot version 3.3.4
14+
- [fj-doc-maven-plugin] goal init, flavour quarkus-3, default quarkus version 3.15.0
15+
16+
### Fixed
17+
18+
- [fj-doc-freemarker] handle space-before and space-after in table #206 [html]
19+
- [fj-doc-mod-fop] handle space-before and space-after in table #206 [pdf]
1320

1421
## [8.8.7] - 2024-09-16
1522

fj-doc-freemarker/src/main/resources/fj_doc_freemarker_config/template/macro/html_element.ftl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
<@handleRowInline docTable=docTable row=row docTableUtil=docTableUtil/>
112112
</#list>
113113
<#else>
114-
<table style='width: ${docTable.width}%'<#if (docTable.alt)??> aria-describedby="${docTable.alt}"</#if>>
114+
<table style='<@handleTableSpacing dc=docTable/> width: ${docTable.width}%'<#if (docTable.alt)??> aria-describedby="${docTable.alt}"</#if>>
115115
<#if (docTableUtil.strictHeader)>
116116
<thead>
117117
<@handleRowList docTable=docTable rowList=docTableUtil.headerRows cellType='th'/>
@@ -156,6 +156,7 @@ white-space-collapse -> false : white-space-collapse: preserve; white-space: pre
156156
-->
157157
<#macro handlePadding amt dir><#if (amt > 0)> padding-${dir}: ${amt}px;</#if></#macro>
158158
<#macro handleSpacing dc><@handlePadding amt=dc.spaceBefore!0 dir='top'/><@handlePadding amt=((dc.leading!0)*10 + dc.spaceAfter!0) dir='bottom'/><@handlePadding amt=((dc.textIndent!0)*10 + dc.spaceLeft!0) dir='left'/><@handlePadding amt=dc.spaceRight!0 dir='right'/><#if dc.notWhiteSpaceCollapse> white-space-collapse: preserve; white-space: pre-wrap;</#if></#macro>
159+
<#macro handleTableSpacing dc><@handlePadding amt=dc.spaceBefore!0 dir='top'/><@handlePadding amt=((dc.leading!0)*10 + dc.spaceAfter!0) dir='bottom'/></#macro>
159160

160161
<#macro handleAlign alignValue><#if alignValue = 1> text-align: left;<#elseif alignValue = 2> text-align: center;<#elseif alignValue = 3> text-align: right;<#elseif alignValue = 8 || alignValue = 9> text-align: justify;</#if></#macro>
161162

fj-doc-freemarker/src/test/resources/coverage/xml/default_doc.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<para size="3" fore-color="#dddddd">Test default font</para>
4040
<br/>
4141
<page-break/>
42-
<table columns="3" colwidths="30;30;40" width="100" id="excel-table" padding="2">
42+
<table space-before="20" columns="3" colwidths="30;30;40" width="100" id="excel-table" padding="2">
4343
<row>
4444
<cell align="center" border-color="#000000" border-width="1"><para style="bold">Name</para></cell>
4545
<cell align="center"><para style="bold">Surname</para></cell>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# default flavour versions
2-
quarkus-3=3.14.3
2+
quarkus-3=3.15.0
33
quarkus-2=2.16.12.Final
44
micronaut-4=4.6.2
5-
springboot-3=3.3.3
5+
springboot-3=3.3.4
66
openliberty=20.0.0.9

fj-doc-mod-fop/src/main/resources/fj_doc_mod_fop_config/template/macro/doc_element.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
<@handleRowInline docTable=docTable row=row docTableUtil=docTableUtil/>
125125
</#list>
126126
<#else>
127-
<fo:table border-collapse="${docBase.stableInfo['table-border-collapse']!'separate'}" width="${docTable.width}%" table-layout="fixed" <#if (docTable.spacing)??>border-separation="${docTable.spacing}px"</#if>>
127+
<fo:table <@handleSpacing dc=docTable/> border-collapse="${docBase.stableInfo['table-border-collapse']!'separate'}" width="${docTable.width}%" table-layout="fixed" <#if (docTable.spacing)??>border-separation="${docTable.spacing}px"</#if>>
128128
<#list docTable.colWithds as currentColWidth>
129129
<fo:table-column column-width="${currentColWidth}%" />
130130
</#list>

fj-doc-mod-fop/src/test/resources/sample/doc_alt_01.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
</footer-ext>
1010
</metadata>
1111
<body>
12-
<table columns="3" colwidths="30;30;40" id="excel-table" padding="2" width="100">
12+
<h head-level="1">Alternative sample doc</h>
13+
<table space-before="30" columns="3" colwidths="30;30;40" id="excel-table" padding="2" width="100">
1314
<row>
1415
<cell align="center" back-color="#99aaee">
1516
<para>Name</para>

0 commit comments

Comments
 (0)