diff options
author | Tor Lillqvist <tml@collabora.com> | 2021-12-29 13:53:54 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2022-01-03 18:05:50 +0100 |
commit | 11d2a2f5d260bb27d0e67f90579ca761cb2250ea (patch) | |
tree | be616964354e9b223c9c8b34883fb61c8bd96a1e /filter | |
parent | 4686b3f623393aa8ce4d44f1d0f97e582a21c545 (diff) |
tdf#146264: Add a somewhat questionable hack to fix the issue
Seems to work but probably has unintended side-effects.
Change-Id: I33c6c78757d84fbb59176788a28645691f87b781
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127683
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/xslt/odf2xhtml/export/xhtml/body.xsl | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl index 5195c3177651..430b834b3cca 100644 --- a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl +++ b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="UTF-8"?> +<?xml version="1.0" encoding="UTF-8"?> <!-- -*- fill-column: 130; nxml-child-indent: 4; tab-width: 4; indent-tabs-mode: nil -*- --> <!-- * This file is part of the LibreOffice project. * @@ -798,6 +798,7 @@ <xsl:param name="leftPosition" select="0" /> <xsl:param name="parentMarginLeft" /> <xsl:param name="stopAtFirstFrame" select="false()" /> + <xsl:param name="tdf146264hack" select="false()" /> <xsl:choose> <xsl:when test="name() = 'draw:frame' and not($stopAtFirstFrame)"> @@ -825,9 +826,14 @@ <xsl:value-of select="$leftPosition"/> <xsl:text>cm;</xsl:text> </xsl:attribute> - <xsl:apply-templates select="."> - <xsl:with-param name="globalData" select="$globalData"/> - </xsl:apply-templates> + <!-- This xsl:if is the meat of the extremely ugly "fix" to tdf#146264. It probably has unintended + bad side-effects. + --> + <xsl:if test="not($tdf146264hack)"> + <xsl:apply-templates select="."> + <xsl:with-param name="globalData" select="$globalData"/> + </xsl:apply-templates> + </xsl:if> <!-- if it is a frame sibling it will be NOT encapsulated within the div (as already within one) --> <xsl:if test="not($nextSiblingIsFrame)"> <xsl:apply-templates select="following-sibling::node()[1]" mode="frameFloating"> @@ -898,11 +904,13 @@ <xsl:param name="globalData"/> <xsl:param name="previousFrameWidths" select="0"/> <xsl:param name="previousFrameHeights" select="0" /> + <xsl:param name="tdf146264hack" select="false()" /> <xsl:call-template name="createDrawFrame"> <xsl:with-param name="globalData" select="$globalData" /> <xsl:with-param name="previousFrameWidths" select="$previousFrameWidths"/> <xsl:with-param name="previousFrameHeights" select="$previousFrameHeights"/> + <xsl:with-param name="tdf146264hack" select="$tdf146264hack"/> </xsl:call-template> <!-- after the last draw:frame sibling the CSS float is disabled --> <xsl:if test="@text:anchor-type!='as-char'"> @@ -946,6 +954,7 @@ <xsl:param name="previousFrameHeights" select="0" /> <xsl:param name="parentMarginLeft"/> <xsl:param name="stopAtFirstFrame" select="false()" /> + <xsl:param name="tdf146264hack" select="false()" /> <xsl:variable name="parentMarginLeftNew"> <xsl:choose> @@ -1030,6 +1039,7 @@ <xsl:with-param name="parentMarginLeft" select="$parentMarginLeftNew"/> <xsl:with-param name="leftPosition" select="$leftPosition"/> <xsl:with-param name="stopAtFirstFrame" select="$stopAtFirstFrame" /> + <xsl:with-param name="tdf146264hack" select="$tdf146264hack" /> </xsl:apply-templates> </xsl:template> @@ -2551,6 +2561,7 @@ <xsl:apply-templates> <xsl:with-param name="globalData" select="$globalData"/> <xsl:with-param name="listIndent" select="$minLabelWidth"/> + <xsl:with-param name="tdf146264hack" select="true()"/> </xsl:apply-templates> <!-- this span disables the float necessary to bring two block elements on one line. It contains a space as IE6 bug workaround --> <span class="odfLiEnd"></span> |