|
|
f085be |
From 4d003b92fa632d38909543b7317ceb75c96beeac Mon Sep 17 00:00:00 2001
|
|
|
f085be |
From: Julien Nabet <serval2412@yahoo.fr>
|
|
|
f085be |
Date: Mon, 21 Jul 2014 11:36:27 +0200
|
|
|
f085be |
Subject: [PATCH 049/137] Resolves fdo#81581: Mediawiki doesn't recognize
|
|
|
f085be |
underlining
|
|
|
f085be |
|
|
|
f085be |
Cherry-picked from b8f4db5bad245c2e340b3217b10df994785eecd3
|
|
|
f085be |
|
|
|
f085be |
Change-Id: I27ec27bd733e5161bbd18ba7cf813daa3ac6c089
|
|
|
f085be |
Reviewed-on: https://gerrit.libreoffice.org/10438
|
|
|
f085be |
Reviewed-by: Andras Timar <andras.timar@collabora.com>
|
|
|
f085be |
Tested-by: Andras Timar <andras.timar@collabora.com>
|
|
|
f085be |
---
|
|
|
f085be |
swext/mediawiki/src/filter/odt2mediawiki.xsl | 59 ++++++++++++++++++++++++----
|
|
|
f085be |
1 file changed, 51 insertions(+), 8 deletions(-)
|
|
|
f085be |
|
|
|
f085be |
diff --git a/swext/mediawiki/src/filter/odt2mediawiki.xsl b/swext/mediawiki/src/filter/odt2mediawiki.xsl
|
|
|
f085be |
index 64474b3..1205536 100644
|
|
|
f085be |
--- a/swext/mediawiki/src/filter/odt2mediawiki.xsl
|
|
|
f085be |
+++ b/swext/mediawiki/src/filter/odt2mediawiki.xsl
|
|
|
f085be |
@@ -118,23 +118,26 @@
|
|
|
f085be |
|
|
|
f085be |
<variable name="ITALIC_BIT" select="2"/>
|
|
|
f085be |
|
|
|
f085be |
+
|
|
|
f085be |
+ <variable name="UNDERLINE_BIT" select="4"/>
|
|
|
f085be |
+
|
|
|
f085be |
|
|
|
f085be |
- <variable name="SUBSCRIPT_BIT" select="4"/>
|
|
|
f085be |
+ <variable name="SUBSCRIPT_BIT" select="8"/>
|
|
|
f085be |
|
|
|
f085be |
|
|
|
f085be |
- <variable name="SUPERSCRIPT_BIT" select="8"/>
|
|
|
f085be |
+ <variable name="SUPERSCRIPT_BIT" select="16"/>
|
|
|
f085be |
|
|
|
f085be |
|
|
|
f085be |
- <variable name="TYPEWRITER_BIT" select="16"/>
|
|
|
f085be |
+ <variable name="TYPEWRITER_BIT" select="32"/>
|
|
|
f085be |
|
|
|
f085be |
|
|
|
f085be |
- <variable name="CODE_BIT" select="32"/>
|
|
|
f085be |
+ <variable name="CODE_BIT" select="64"/>
|
|
|
f085be |
|
|
|
f085be |
|
|
|
f085be |
- <variable name="CENTER_BIT" select="64"/>
|
|
|
f085be |
+ <variable name="CENTER_BIT" select="128"/>
|
|
|
f085be |
|
|
|
f085be |
|
|
|
f085be |
- <variable name="RIGHT_BIT" select="128"/>
|
|
|
f085be |
+ <variable name="RIGHT_BIT" select="256"/>
|
|
|
f085be |
|
|
|
f085be |
|
|
|
f085be |
<variable name="NO_STYLE" select="0"/>
|
|
|
f085be |
@@ -976,6 +979,8 @@
|
|
|
f085be |
select="($style mod (2 * $BOLD_BIT)) != 0"/>
|
|
|
f085be |
|
|
|
f085be |
select="($style mod (2 * $ITALIC_BIT)) - ($style mod ($ITALIC_BIT)) != 0"/>
|
|
|
f085be |
+
|
|
|
f085be |
+ select="($style mod (2 * $UNDERLINE_BIT)) - ($style mod ($UNDERLINE_BIT)) != 0"/>
|
|
|
f085be |
|
|
|
f085be |
select="($style mod (2 * $SUPERSCRIPT_BIT)) - ($style mod ($SUPERSCRIPT_BIT)) != 0"/>
|
|
|
f085be |
|
|
|
f085be |
@@ -989,6 +994,8 @@
|
|
|
f085be |
select="($style-left mod (2 * $BOLD_BIT)) != 0"/>
|
|
|
f085be |
|
|
|
f085be |
select="($style-left mod (2 * $ITALIC_BIT)) - ($style-left mod ($ITALIC_BIT)) != 0"/>
|
|
|
f085be |
+
|
|
|
f085be |
+ select="($style-left mod (2 * $UNDERLINE_BIT)) - ($style-left mod ($UNDERLINE_BIT)) != 0"/>
|
|
|
f085be |
|
|
|
f085be |
select="($style-left mod (2 * $SUPERSCRIPT_BIT)) - ($style-left mod ($SUPERSCRIPT_BIT)) != 0"/>
|
|
|
f085be |
|
|
|
f085be |
@@ -1000,6 +1007,8 @@
|
|
|
f085be |
select="($style-right mod (2 * $BOLD_BIT)) != 0"/>
|
|
|
f085be |
|
|
|
f085be |
select="($style-right mod (2 * $ITALIC_BIT)) - ($style-right mod ($ITALIC_BIT)) != 0"/>
|
|
|
f085be |
+
|
|
|
f085be |
+ select="($style-right mod (2 * $UNDERLINE_BIT)) - ($style-right mod ($UNDERLINE_BIT)) != 0"/>
|
|
|
f085be |
|
|
|
f085be |
select="($style-right mod (2 * $SUPERSCRIPT_BIT)) - ($style-right mod ($SUPERSCRIPT_BIT)) != 0"/>
|
|
|
f085be |
|
|
|
f085be |
@@ -1027,6 +1036,9 @@
|
|
|
f085be |
<if test="not($code) and $typewriter and not($typewriter-left)">
|
|
|
f085be |
<text><tt></text>
|
|
|
f085be |
</if>
|
|
|
f085be |
+ <if test="$underline and not($underline-left)">
|
|
|
f085be |
+ <text><u></text>
|
|
|
f085be |
+ </if>
|
|
|
f085be |
<if test="$bold and not($bold-left)">
|
|
|
f085be |
<text>'''</text>
|
|
|
f085be |
</if>
|
|
|
f085be |
@@ -1044,6 +1056,9 @@
|
|
|
f085be |
<if test="$bold and not($bold-right)">
|
|
|
f085be |
<text>'''</text>
|
|
|
f085be |
</if>
|
|
|
f085be |
+ <if test="$underline and not($underline-right)">
|
|
|
f085be |
+ <text></u></text>
|
|
|
f085be |
+ </if>
|
|
|
f085be |
<if test="not($code) and $typewriter and not($typewriter-right)">
|
|
|
f085be |
<text></tt></text>
|
|
|
f085be |
</if>
|
|
|
f085be |
@@ -1255,6 +1270,8 @@
|
|
|
f085be |
select="($style-mask mod (2 * $BOLD_BIT)) = 0"/>
|
|
|
f085be |
|
|
|
f085be |
select="($style-mask mod (2 * $ITALIC_BIT)) - ($style-mask mod ($ITALIC_BIT)) = 0"/>
|
|
|
f085be |
+
|
|
|
f085be |
+ select="($style-mask mod (2 * $UNDERLINE_BIT)) - ($style-mask mod ($UNDERLINE_BIT)) = 0"/>
|
|
|
f085be |
|
|
|
f085be |
select="($style-mask mod (2 * $SUPERSCRIPT_BIT)) - ($style-mask mod ($SUPERSCRIPT_BIT)) = 0"/>
|
|
|
f085be |
|
|
|
f085be |
@@ -1321,6 +1338,32 @@
|
|
|
f085be |
</choose>
|
|
|
f085be |
</variable>
|
|
|
f085be |
|
|
|
f085be |
+ <variable name="underline-style">
|
|
|
f085be |
+ <choose>
|
|
|
f085be |
+ <when test="$underline-requested and boolean($text-properties/@style:text-underline-style='solid')">
|
|
|
f085be |
+
|
|
|
f085be |
+ <value-of select="$UNDERLINE_BIT"/>
|
|
|
f085be |
+ </when>
|
|
|
f085be |
+ <otherwise>
|
|
|
f085be |
+ <value-of select="$NO_STYLE"/>
|
|
|
f085be |
+ </otherwise>
|
|
|
f085be |
+ </choose>
|
|
|
f085be |
+ </variable>
|
|
|
f085be |
+ <variable name="underline-mask">
|
|
|
f085be |
+ <choose>
|
|
|
f085be |
+ <when test="$underline-requested and boolean($text-properties/@style:text-underline-style='solid')">
|
|
|
f085be |
+
|
|
|
f085be |
+ Other value than "underline" means that the character style is not
|
|
|
f085be |
+ underline and no parent style must be considered.
|
|
|
f085be |
+ -->
|
|
|
f085be |
+ <value-of select="$UNDERLINE_BIT"/>
|
|
|
f085be |
+ </when>
|
|
|
f085be |
+ <otherwise>
|
|
|
f085be |
+ <value-of select="$NO_STYLE"/>
|
|
|
f085be |
+ </otherwise>
|
|
|
f085be |
+ </choose>
|
|
|
f085be |
+ </variable>
|
|
|
f085be |
+
|
|
|
f085be |
<variable name="superscript-style">
|
|
|
f085be |
<choose>
|
|
|
f085be |
<when test="$superscript-requested and contains($text-properties/@style:text-position, 'super')">
|
|
|
f085be |
@@ -1473,9 +1516,9 @@
|
|
|
f085be |
guaranteed to be disjoint, therefore, addition can be use instead
|
|
|
f085be |
of bitwise or (which is missing in XPath). -->
|
|
|
f085be |
|
|
|
f085be |
- select="$style-set + $bold-style + $italic-style + $superscript-style + $subscript-style + $code-style + $typewriter-style + $center-style + $right-style"/>
|
|
|
f085be |
+ select="$style-set + $bold-style + $italic-style + $underline-style + $superscript-style + $subscript-style + $code-style + $typewriter-style + $center-style + $right-style"/>
|
|
|
f085be |
|
|
|
f085be |
- select="$style-mask + $bold-mask + $italic-mask + $superscript-mask + $subscript-mask + $code-mask + $typewriter-mask + $center-mask + $right-mask"/>
|
|
|
f085be |
+ select="$style-mask + $bold-mask + $italic-mask + $underline-mask + $superscript-mask + $subscript-mask + $code-mask + $typewriter-mask + $center-mask + $right-mask"/>
|
|
|
f085be |
|
|
|
f085be |
|
|
|
f085be |
<choose>
|
|
|
f085be |
--
|
|
|
f085be |
1.9.3
|
|
|
f085be |
|