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

Robert Antoni Buj Gelonch robert.buj at gmail.com
Mon May 18 10:26:43 PDT 2015


 swext/mediawiki/src/filter/odt2mediawiki.xsl |   31 +++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

New commits:
commit b532d46551489e84d2754c815f5076f47f824117
Author: Robert Antoni Buj Gelonch <robert.buj at gmail.com>
Date:   Mon May 18 14:15:28 2015 +0200

    odt2mediawiki.xsl: tabulation in toc entries
    
    Change-Id: I596bd1c8814efcf2070d3e6d2ff126c03c0ec168
    Reviewed-on: https://gerrit.libreoffice.org/15785
    Tested-by: David Tardon <dtardon at redhat.com>
    Reviewed-by: David Tardon <dtardon at redhat.com>

diff --git a/swext/mediawiki/src/filter/odt2mediawiki.xsl b/swext/mediawiki/src/filter/odt2mediawiki.xsl
index d8a9fba..f0a9f12 100644
--- a/swext/mediawiki/src/filter/odt2mediawiki.xsl
+++ b/swext/mediawiki/src/filter/odt2mediawiki.xsl
@@ -174,6 +174,12 @@
 	/>
 	
 	<key
+		name="text:table-of-content-entry-ref"
+		match="//text:table-of-content-entry-template"
+		use="@text:style-name"
+	/>
+
+	<key
 		name="reference-resolution"
 		match="//text:reference-mark | //text:reference-mark-start"
 		use="@text:name"
@@ -699,6 +705,21 @@
 		</choose>
 	</template>
 
+        <!--
+		Function for generating tabulations in TOC entries.
+
+		@param style
+			The style of the TOC entry
+	-->
+	<template name="mk-tab-toc">
+		<param name="style"/>
+		<if test="number($style/@text:outline-level) > 0">
+			<call-template name="mk-token">
+				<with-param name="level" select="number($style/@text:outline-level) - 1"/>
+				<with-param name="char" select="':'"/>
+			</call-template>
+		</if>
+	</template>
 
 	<!-- 
 		== WikiLink == 
@@ -726,6 +747,16 @@
 	 -->
 
 	<template match="text:p">
+		<!-- TOC tabs -->
+		<if test="ancestor::text:index-body and boolean(@text:style-name)">
+			<variable name="style" select="key('style-ref', @text:style-name)"/>
+			<if test="boolean($style/@style:parent-style-name)">
+				<call-template name="mk-tab-toc">
+					<with-param name="style" select="key('text:table-of-content-entry-ref', $style/@style:parent-style-name)"/>
+				</call-template>
+			</if>
+		</if>
+
 		<variable name="alignment">
 			<call-template name="mk-style-set">
 				<with-param name="node" select="."/>


More information about the Libreoffice-commits mailing list