summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorSvante Schubert <svante.schubert@gmail.com>2020-08-24 11:48:01 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2021-03-02 13:21:04 +0100
commit3282db181aa63dda00ca7c45af1037911762e5b3 (patch)
treedfeb26acdfd50729e7da58b9815cd8f6abe470e9 /filter
parent63b4f0c693cf181e63772170c0c2c6179ec1b621 (diff)
HTML XSLT: Only write page {} information when they exist
Change-Id: I213645835745e992fe6f2aa79a678d177a97c45f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111611 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/xslt/odf2xhtml/export/xhtml/header.xsl25
1 files changed, 14 insertions, 11 deletions
diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/header.xsl b/filter/source/xslt/odf2xhtml/export/xhtml/header.xsl
index 8264aa50ad67..d5043d07c4b0 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/header.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/header.xsl
@@ -167,20 +167,23 @@
<!-- Find the according style:page-layout and store the properties in a variable -->
<xsl:variable name="pageProperties" select="key('pageLayoutElements', $pageLayoutName)/style:page-layout-properties"/>
-<xsl:text>@page { </xsl:text>
-
- <xsl:call-template name="page-size">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="pageProperties" select="$pageProperties" />
- </xsl:call-template>
- <xsl:call-template name="page-margin">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="pageProperties" select="$pageProperties" />
- </xsl:call-template>
+ <xsl:variable name="pageSize">
+ <xsl:call-template name="page-size">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="pageProperties" select="$pageProperties" />
+ </xsl:call-template>
+ <xsl:call-template name="page-margin">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="pageProperties" select="$pageProperties" />
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="$pageSize and $pageSize!=''">
+<xsl:text>@page { </xsl:text>
+<xsl:value-of select="$pageSize"/>
<xsl:text> }
</xsl:text>
-
+ </xsl:if>
</xsl:template>