Skip to content

Commit

Permalink
cct13#9689#morerows in thead cells should be generated even if it ove…
Browse files Browse the repository at this point in the history
…rspans tbody cells
  • Loading branch information
boskarine committed Dec 16, 2023
1 parent 17d1326 commit a2c02ec
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions xsl/tables.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -597,23 +597,27 @@

<xsl:template name="cell.morerows">
<xsl:if test="w:tcPr/w:vMerge/@w:val = 'restart'">
<xsl:variable name="is-thead-tr" as="xs:boolean"
<!--<xsl:variable name="is-thead-tr" as="xs:boolean"
select="exists(parent::w:tr[docx2hub:is-tableheader-row(.,
count(preceding-sibling::w:tr)+1,
ancestor::w:tbl[1]/w:tblPr/w:tblLook)])"/>
ancestor::w:tbl[1]/w:tblPr/w:tblLook)])"/>-->
<xsl:variable name="next-non-vmerged-tr" as="element(w:tr)?"
select="../following-sibling::w:tr[not(docx2hub:is-blind-vmerged-row(.))][1]"/>
<xsl:variable name="counts" as="xs:integer*">
<xsl:choose>
<xsl:when test="$is-thead-tr = true()
<!-- KW: Word ignores the header information when it comes to rowspanning and so should we -->
<!--<xsl:when test="$is-thead-tr = true()
and not(../following-sibling::w:tr[1][docx2hub:is-tableheader-row(.,
count(preceding-sibling::w:tr)+1,
ancestor::w:tbl[1]/w:tblPr/w:tblLook)])">
<xsl:sequence select="999"/>
</xsl:when>
</xsl:when>-->
<xsl:when test="$next-non-vmerged-tr/w:tc[tr:colcount(1, .) = tr:colcount(1, current())]
[docx2hub:is-blind-vmerged-cell(.)]">
<xsl:for-each-group select="../following-sibling::w:tr[not(docx2hub:is-blind-vmerged-row(.))][. is $next-non-vmerged-tr or . &gt;&gt; $next-non-vmerged-tr]/w:tc[tr:colcount(1, .) = tr:colcount(1, current())]"
<xsl:for-each-group select="../following-sibling::w:tr[not(docx2hub:is-blind-vmerged-row(.))]
[. is $next-non-vmerged-tr or
. &gt;&gt; $next-non-vmerged-tr]/w:tc[tr:colcount(1, .) =
tr:colcount(1, current())]"
group-adjacent="docx2hub:is-blind-vmerged-cell(.)">
<xsl:sequence select="count(current-group())"/>
</xsl:for-each-group>
Expand Down

0 comments on commit a2c02ec

Please sign in to comment.