odt2mediawiki.xsl: reuse table cell code, check USE_DEFAULT_TABLE_CLASS, use current vbles
Change-Id: Iedaddf11604b13c7db1d2b588a5f205f691ea2b4 Reviewed-on: https://gerrit.libreoffice.org/15440 Tested-by: David Tardon <dtardon@redhat.com> Reviewed-by: David Tardon <dtardon@redhat.com>
This commit is contained in:
committed by
David Tardon
parent
423cfc2061
commit
50c43b030b
@@ -409,67 +409,26 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template match="table:table-row">
|
<template match="table:table-row">
|
||||||
<variable name="style-name" select="table:table-cell[1]/@table:style-name"/>
|
|
||||||
<variable name="total-style-name" select="count(table:table-cell/@table:style-name)"/>
|
|
||||||
<variable name="total-equal-style-name" select="count(table:table-cell[@table:style-name=$style-name])"/>
|
|
||||||
<variable name="style">
|
|
||||||
<if test="$total-equal-style-name=$total-style-name">
|
|
||||||
<variable name="style-element" select="key('style-ref', $style-name)"/>
|
|
||||||
<call-template name="translate-style-property">
|
|
||||||
<with-param name="style-name" select="'background-color'"/>
|
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:background-color"/>
|
|
||||||
</call-template>
|
|
||||||
|
|
||||||
<call-template name="translate-style-property">
|
|
||||||
<with-param name="style-name" select="'border'"/>
|
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:border"/>
|
|
||||||
</call-template>
|
|
||||||
<call-template name="translate-style-property">
|
|
||||||
<with-param name="style-name" select="'border-top'"/>
|
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:border-top"/>
|
|
||||||
</call-template>
|
|
||||||
<call-template name="translate-style-property">
|
|
||||||
<with-param name="style-name" select="'border-bottom'"/>
|
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:border-bottom"/>
|
|
||||||
</call-template>
|
|
||||||
<call-template name="translate-style-property">
|
|
||||||
<with-param name="style-name" select="'border-left'"/>
|
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:border-left"/>
|
|
||||||
</call-template>
|
|
||||||
<call-template name="translate-style-property">
|
|
||||||
<with-param name="style-name" select="'border-right'"/>
|
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:border-right"/>
|
|
||||||
</call-template>
|
|
||||||
|
|
||||||
<call-template name="translate-style-property">
|
|
||||||
<with-param name="style-name" select="'padding'"/>
|
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:padding"/>
|
|
||||||
</call-template>
|
|
||||||
<call-template name="translate-style-property">
|
|
||||||
<with-param name="style-name" select="'padding-top'"/>
|
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:padding-top"/>
|
|
||||||
</call-template>
|
|
||||||
<call-template name="translate-style-property">
|
|
||||||
<with-param name="style-name" select="'padding-bottom'"/>
|
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:padding-bottom"/>
|
|
||||||
</call-template>
|
|
||||||
<call-template name="translate-style-property">
|
|
||||||
<with-param name="style-name" select="'padding-left'"/>
|
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:padding-left"/>
|
|
||||||
</call-template>
|
|
||||||
<call-template name="translate-style-property">
|
|
||||||
<with-param name="style-name" select="'padding-right'"/>
|
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:padding-right"/>
|
|
||||||
</call-template>
|
|
||||||
</if>
|
|
||||||
</variable>
|
|
||||||
|
|
||||||
<text>|-</text>
|
<text>|-</text>
|
||||||
|
|
||||||
<if test="string-length($style) > 0">
|
<if test="not($USE_DEFAULT_TABLE_CLASS) and boolean(table:table-cell[1]/@table:style-name)">
|
||||||
<text> style="</text>
|
<variable name="style-name" select="table:table-cell[1]/@table:style-name"/>
|
||||||
<value-of select="$style"/>
|
<variable name="total-style-name" select="count(table:table-cell/@table:style-name)"/>
|
||||||
<text>" </text>
|
<variable name="total-equal-style-name" select="count(table:table-cell[@table:style-name=$style-name])"/>
|
||||||
|
|
||||||
|
<variable name="style">
|
||||||
|
<if test="$total-equal-style-name=$total-style-name">
|
||||||
|
<call-template name="translate-table-cell-properties">
|
||||||
|
<with-param name="style-element" select="key('style-ref', $style-name)"/>
|
||||||
|
</call-template>
|
||||||
|
</if>
|
||||||
|
</variable>
|
||||||
|
|
||||||
|
<if test="string-length($style) > 0">
|
||||||
|
<text> style="</text>
|
||||||
|
<value-of select="$style"/>
|
||||||
|
<text>"</text>
|
||||||
|
</if>
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<value-of select="$NL"/>
|
<value-of select="$NL"/>
|
||||||
@@ -509,57 +468,14 @@
|
|||||||
</choose>
|
</choose>
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<variable name="style-name" select="@table:style-name"/>
|
|
||||||
<if test="not($USE_DEFAULT_TABLE_CLASS) and boolean(@table:style-name)">
|
<if test="not($USE_DEFAULT_TABLE_CLASS) and boolean(@table:style-name)">
|
||||||
<variable name="style-element" select="key('style-ref', @table:style-name)"/>
|
<variable name="style-name" select="@table:style-name"/>
|
||||||
|
|
||||||
<variable name="style">
|
<variable name="style">
|
||||||
<!-- Only if cells have a different style-name -->
|
<!-- Only if cells have a different style-name -->
|
||||||
<if test="count(../table:table-cell/@table:style-name) != count(../table:table-cell[@table:style-name=$style-name]) and count(../table:table-cell/@table:style-name) > 0">
|
<if test="count(../table:table-cell/@table:style-name) != count(../table:table-cell[@table:style-name=$style-name]) and count(../table:table-cell/@table:style-name) > 0">
|
||||||
<call-template name="translate-style-property">
|
<call-template name="translate-table-cell-properties">
|
||||||
<with-param name="style-name" select="'background-color'"/>
|
<with-param name="style-element" select="key('style-ref', $style-name)"/>
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:background-color"/>
|
|
||||||
</call-template>
|
|
||||||
|
|
||||||
<call-template name="translate-style-property">
|
|
||||||
<with-param name="style-name" select="'border'"/>
|
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:border"/>
|
|
||||||
</call-template>
|
|
||||||
<call-template name="translate-style-property">
|
|
||||||
<with-param name="style-name" select="'border-top'"/>
|
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:border-top"/>
|
|
||||||
</call-template>
|
|
||||||
<call-template name="translate-style-property">
|
|
||||||
<with-param name="style-name" select="'border-bottom'"/>
|
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:border-bottom"/>
|
|
||||||
</call-template>
|
|
||||||
<call-template name="translate-style-property">
|
|
||||||
<with-param name="style-name" select="'border-left'"/>
|
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:border-left"/>
|
|
||||||
</call-template>
|
|
||||||
<call-template name="translate-style-property">
|
|
||||||
<with-param name="style-name" select="'border-right'"/>
|
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:border-right"/>
|
|
||||||
</call-template>
|
|
||||||
|
|
||||||
<call-template name="translate-style-property">
|
|
||||||
<with-param name="style-name" select="'padding'"/>
|
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:padding"/>
|
|
||||||
</call-template>
|
|
||||||
<call-template name="translate-style-property">
|
|
||||||
<with-param name="style-name" select="'padding-top'"/>
|
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:padding-top"/>
|
|
||||||
</call-template>
|
|
||||||
<call-template name="translate-style-property">
|
|
||||||
<with-param name="style-name" select="'padding-bottom'"/>
|
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:padding-bottom"/>
|
|
||||||
</call-template>
|
|
||||||
<call-template name="translate-style-property">
|
|
||||||
<with-param name="style-name" select="'padding-left'"/>
|
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:padding-left"/>
|
|
||||||
</call-template>
|
|
||||||
<call-template name="translate-style-property">
|
|
||||||
<with-param name="style-name" select="'padding-right'"/>
|
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:padding-right"/>
|
|
||||||
</call-template>
|
</call-template>
|
||||||
</if>
|
</if>
|
||||||
</variable>
|
</variable>
|
||||||
@@ -608,59 +524,16 @@
|
|||||||
</choose>
|
</choose>
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<variable name="style-name" select="@table:style-name"/>
|
|
||||||
<if test="not($USE_DEFAULT_TABLE_CLASS) and boolean(@table:style-name)">
|
<if test="not($USE_DEFAULT_TABLE_CLASS) and boolean(@table:style-name)">
|
||||||
<variable name="style-element" select="key('style-ref', @table:style-name)"/>
|
<variable name="style-name" select="@table:style-name"/>
|
||||||
<variable name="style">
|
|
||||||
|
<variable name="style">
|
||||||
<!-- Only if cells have a different style-name -->
|
<!-- Only if cells have a different style-name -->
|
||||||
<if test="count(../table:table-cell/@table:style-name) != count(../table:table-cell[@table:style-name=$style-name]) and count(../table:table-cell/@table:style-name) > 0">
|
<if test="count(../table:table-cell/@table:style-name) != count(../table:table-cell[@table:style-name=$style-name]) and count(../table:table-cell/@table:style-name) > 0">
|
||||||
<call-template name="translate-style-property">
|
<call-template name="translate-table-cell-properties">
|
||||||
<with-param name="style-name" select="'background-color'"/>
|
<with-param name="style-element" select="key('style-ref', $style-name)"/>
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:background-color"/>
|
|
||||||
</call-template>
|
</call-template>
|
||||||
|
</if>
|
||||||
<call-template name="translate-style-property">
|
|
||||||
<with-param name="style-name" select="'border'"/>
|
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:border"/>
|
|
||||||
</call-template>
|
|
||||||
<call-template name="translate-style-property">
|
|
||||||
<with-param name="style-name" select="'border-top'"/>
|
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:border-top"/>
|
|
||||||
</call-template>
|
|
||||||
<call-template name="translate-style-property">
|
|
||||||
<with-param name="style-name" select="'border-bottom'"/>
|
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:border-bottom"/>
|
|
||||||
</call-template>
|
|
||||||
<call-template name="translate-style-property">
|
|
||||||
<with-param name="style-name" select="'border-left'"/>
|
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:border-left"/>
|
|
||||||
</call-template>
|
|
||||||
<call-template name="translate-style-property">
|
|
||||||
<with-param name="style-name" select="'border-right'"/>
|
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:border-right"/>
|
|
||||||
</call-template>
|
|
||||||
|
|
||||||
<call-template name="translate-style-property">
|
|
||||||
<with-param name="style-name" select="'padding'"/>
|
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:padding"/>
|
|
||||||
</call-template>
|
|
||||||
<call-template name="translate-style-property">
|
|
||||||
<with-param name="style-name" select="'padding-top'"/>
|
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:padding-top"/>
|
|
||||||
</call-template>
|
|
||||||
<call-template name="translate-style-property">
|
|
||||||
<with-param name="style-name" select="'padding-bottom'"/>
|
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:padding-bottom"/>
|
|
||||||
</call-template>
|
|
||||||
<call-template name="translate-style-property">
|
|
||||||
<with-param name="style-name" select="'padding-left'"/>
|
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:padding-left"/>
|
|
||||||
</call-template>
|
|
||||||
<call-template name="translate-style-property">
|
|
||||||
<with-param name="style-name" select="'padding-right'"/>
|
|
||||||
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:padding-right"/>
|
|
||||||
</call-template>
|
|
||||||
</if>
|
|
||||||
</variable>
|
</variable>
|
||||||
|
|
||||||
<if test="string-length($style) > 0">
|
<if test="string-length($style) > 0">
|
||||||
@@ -674,7 +547,57 @@
|
|||||||
<value-of select="$NL"/>
|
<value-of select="$NL"/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template name="translate-style-property">
|
<template name="translate-table-cell-properties">
|
||||||
|
<param name="style-element"/>
|
||||||
|
<call-template name="translate-style-property">
|
||||||
|
<with-param name="style-name" select="'background-color'"/>
|
||||||
|
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:background-color"/>
|
||||||
|
</call-template>
|
||||||
|
|
||||||
|
<call-template name="translate-style-property">
|
||||||
|
<with-param name="style-name" select="'border'"/>
|
||||||
|
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:border"/>
|
||||||
|
</call-template>
|
||||||
|
<call-template name="translate-style-property">
|
||||||
|
<with-param name="style-name" select="'border-top'"/>
|
||||||
|
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:border-top"/>
|
||||||
|
</call-template>
|
||||||
|
<call-template name="translate-style-property">
|
||||||
|
<with-param name="style-name" select="'border-bottom'"/>
|
||||||
|
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:border-bottom"/>
|
||||||
|
</call-template>
|
||||||
|
<call-template name="translate-style-property">
|
||||||
|
<with-param name="style-name" select="'border-left'"/>
|
||||||
|
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:border-left"/>
|
||||||
|
</call-template>
|
||||||
|
<call-template name="translate-style-property">
|
||||||
|
<with-param name="style-name" select="'border-right'"/>
|
||||||
|
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:border-right"/>
|
||||||
|
</call-template>
|
||||||
|
|
||||||
|
<call-template name="translate-style-property">
|
||||||
|
<with-param name="style-name" select="'padding'"/>
|
||||||
|
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:padding"/>
|
||||||
|
</call-template>
|
||||||
|
<call-template name="translate-style-property">
|
||||||
|
<with-param name="style-name" select="'padding-top'"/>
|
||||||
|
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:padding-top"/>
|
||||||
|
</call-template>
|
||||||
|
<call-template name="translate-style-property">
|
||||||
|
<with-param name="style-name" select="'padding-bottom'"/>
|
||||||
|
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:padding-bottom"/>
|
||||||
|
</call-template>
|
||||||
|
<call-template name="translate-style-property">
|
||||||
|
<with-param name="style-name" select="'padding-left'"/>
|
||||||
|
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:padding-left"/>
|
||||||
|
</call-template>
|
||||||
|
<call-template name="translate-style-property">
|
||||||
|
<with-param name="style-name" select="'padding-right'"/>
|
||||||
|
<with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:padding-right"/>
|
||||||
|
</call-template>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template name="translate-style-property">
|
||||||
<param name="style-name"/>
|
<param name="style-name"/>
|
||||||
<param name="style-property"/>
|
<param name="style-property"/>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user