[PATCH 14/17] XHTML export: avoid useless attempts to convert measures

andrew-libreoffice.org at pileofstuff.org andrew-libreoffice.org at pileofstuff.org
Thu Aug 14 14:53:54 PDT 2014


From: Andrew Sayers <andrew-libreoffice.org at pileofstuff.org>

---
 .../odf2xhtml/export/common/styles/style_mapping_css.xsl | 11 ++++++++---
 filter/source/xslt/odf2xhtml/export/xhtml/body.xsl       | 16 ++++++++++------
 2 files changed, 18 insertions(+), 9 deletions(-)

diff --git filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl
index 822ba0b..79b8954 100644
--- filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl
+++ filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl
@@ -344,9 +344,14 @@
 		<xsl:param name="multiplier"/>
 
 		<xsl:variable name="borderWidthByCentimeter">
-			<xsl:call-template name="convert2cm">
-				<xsl:with-param name="value" select="$borderWidth"/>
-			</xsl:call-template>
+			<xsl:choose>
+				<xsl:when test="$borderWidth = ''">0</xsl:when>
+				<xsl:otherwise>
+					<xsl:call-template name="convert2cm">
+						<xsl:with-param name="value" select="$borderWidth"/>
+					</xsl:call-template>
+				</xsl:otherwise>
+			</xsl:choose>
 		</xsl:variable>
 		<xsl:variable name="minimalBorderWidth" select="0.0133 * $multiplier"/>
 		<xsl:choose>
diff --git filter/source/xslt/odf2xhtml/export/xhtml/body.xsl filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
index 51fb7b6..1126f8e 100644
--- filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
+++ filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
@@ -596,9 +596,11 @@
 
 		<xsl:text>position:absolute;left:</xsl:text>
 		<xsl:variable name="tabPosition">
-			<xsl:call-template name="convert2cm">
-				<xsl:with-param name="value" select="$tabStops/style:tab-stop[$tabCount]/@style:position"/>
-			</xsl:call-template>
+			<xsl:if test="$tabStops/style:tab-stop[$tabCount]/@style:position">
+				<xsl:call-template name="convert2cm">
+					<xsl:with-param name="value" select="$tabStops/style:tab-stop[$tabCount]/@style:position"/>
+				</xsl:call-template>
+			</xsl:if>
 		</xsl:variable>
 		<xsl:variable name="tabIndent">
 			<xsl:choose>
@@ -2000,9 +2002,11 @@
 													<xsl:otherwise>
 														<xsl:variable name="listLevelLabelAlignment" select="$listLevelStyle/style:list-level-properties/style:list-level-label-alignment"/>
 														<xsl:variable name="listLevelTextIndent">
-															<xsl:call-template name="convert2cm">
-																<xsl:with-param name="value" select="string($listLevelLabelAlignment/@fo:text-indent)"/>
-															</xsl:call-template>
+															<xsl:if test="$listLevelLabelAlignment/@fo:text-indent">
+																<xsl:call-template name="convert2cm">
+																	<xsl:with-param name="value" select="string($listLevelLabelAlignment/@fo:text-indent)"/>
+																</xsl:call-template>
+															</xsl:if>
 														</xsl:variable>
 														<xsl:value-of select="-$listLevelTextIndent"/>
 													</xsl:otherwise>
-- 
1.8.5.1



More information about the LibreOffice mailing list