[Libreoffice-commits] core.git: swext/mediawiki

Robert Antoni Buj Gelonch robert.buj at gmail.com
Mon Apr 20 08:56:52 PDT 2015


 swext/mediawiki/src/filter/odt2mediawiki.xsl |   61 ++++++++++++++++++---------
 1 file changed, 41 insertions(+), 20 deletions(-)

New commits:
commit a323ec686a25cfe9049b02a57642dd225b3b8319
Author: Robert Antoni Buj Gelonch <robert.buj at gmail.com>
Date:   Mon Apr 20 16:10:43 2015 +0200

    odt2mediawiki.xsl: table cell color in cell attributes
    
    Change-Id: I44f1969a227a811cdb740b387e30cf10994360b9
    Reviewed-on: https://gerrit.libreoffice.org/15445
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>

diff --git a/swext/mediawiki/src/filter/odt2mediawiki.xsl b/swext/mediawiki/src/filter/odt2mediawiki.xsl
index 54f6003..c9f5964 100644
--- a/swext/mediawiki/src/filter/odt2mediawiki.xsl
+++ b/swext/mediawiki/src/filter/odt2mediawiki.xsl
@@ -534,7 +534,18 @@
 						<with-param name="style-element" select="key('style-ref', $style-name)"/>
 					</call-template>
                                 </if>
-                        </variable>
+				<!-- Font color -->
+				<if test="text:p and count(*) = 1">
+					<if test="boolean(text:p/@text:style-name)">
+						<variable name="style-element" select="key('style-ref', text:p/@text:style-name)"/>
+
+						<call-template name="translate-style-property">
+							<with-param name="style-name" select="'color'"/>
+							<with-param name="style-property" select="$style-element/style:text-properties/@fo:color"/>
+						</call-template>
+					</if>
+				</if>
+			</variable>
 			
 			<if test="string-length($style) > 0">
 				<text> style="</text>
@@ -702,26 +713,37 @@
 			select="($alignment mod (2 * $RIGHT_BIT)) - ($alignment mod ($RIGHT_BIT)) != 0"/>
 
 		<variable name="style">
-			<if test="name(parent::*) != 'table:table-cell'">
-				<choose>
-					<when test="$center">
-						<text>text-align:center;</text>
-					</when>
-					<when test="$right">
-						<text>text-align:right;</text>
-					</when>
-				</choose>
-			</if>
-			<if test="boolean(@text:style-name)">
-				<variable name="style-element" select="key('style-ref', @text:style-name)"/>
+			<choose>
+				<when test="name(parent::*) != 'table:table-cell'">
+					<choose>
+						<when test="$center">
+							<text>text-align:center;</text>
+						</when>
+						<when test="$right">
+							<text>text-align:right;</text>
+						</when>
+					</choose>
+					<if test="boolean(@text:style-name)">
+						<variable name="style-element" select="key('style-ref', @text:style-name)"/>
 
-				<call-template name="translate-style-property">
-					<with-param name="style-name" select="'color'"/>
-					<with-param name="style-property" select="$style-element/style:text-properties/@fo:color"/>
-				</call-template>
-			</if>
-		</variable>
+						<call-template name="translate-style-property">
+							<with-param name="style-name" select="'color'"/>
+							<with-param name="style-property" select="$style-element/style:text-properties/@fo:color"/>
+						</call-template>
+					</if>
+				</when>
+				<otherwise>
+					<if test="count(../text:p) > 1 and boolean(@text:style-name)">
+						<variable name="style-element" select="key('style-ref', @text:style-name)"/>
 
+                                                <call-template name="translate-style-property">
+							<with-param name="style-name" select="'color'"/>
+							<with-param name="style-property" select="$style-element/style:text-properties/@fo:color"/>
+						</call-template>
+					</if>
+				</otherwise>
+			</choose>
+		</variable>
 
 		<if test="string-length($style) > 0">
 			<text><div style="</text>
@@ -800,7 +822,6 @@
 		<value-of select="$NL"/>
 	</template>
 
-
 	<!-- 
 		== Preformatted text == 
 	-->


More information about the Libreoffice-commits mailing list