Kaydet (Commit) e96f95fd authored tarafından Samuel Mehrbrodt's avatar Samuel Mehrbrodt

tdf#113696 XHTML Export: Prefer fallback graphic

Which is usually png and browsers can read that,
but they can't read our internal metafile format (svm)

Change-Id: Idfd82da630ead69f508b74285081e32315030825
Reviewed-on: https://gerrit.libreoffice.org/45590Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Reviewed-on: https://gerrit.libreoffice.org/45679
üst 8dae93c0
...@@ -1483,27 +1483,32 @@ ...@@ -1483,27 +1483,32 @@
<xsl:template match="draw:image | draw:object-ole"> <xsl:template match="draw:image | draw:object-ole">
<xsl:param name="globalData"/> <xsl:param name="globalData"/>
<xsl:choose> <!-- If there is a replacement graphic, we take it.
<xsl:when test="ancestor::text:p or parent::text:span or parent::text:h or parent::draw:a or parent::text:a or text:ruby-base"> It is a png which browsers are more likely able to render than the original graphic
<!-- XHTML does not allow the mapped elements to contain paragraphs --> which might have arbitrary formats. -->
<xsl:call-template name="create-image-element"> <xsl:if test="not(following-sibling::draw:image)">
<xsl:with-param name="globalData" select="$globalData"/> <xsl:choose>
</xsl:call-template> <xsl:when test="ancestor::text:p or parent::text:span or parent::text:h or parent::draw:a or parent::text:a or text:ruby-base">
</xsl:when> <!-- XHTML does not allow the mapped elements to contain paragraphs -->
<xsl:otherwise>
<!-- images are embedded in a paragraph, but are in CSS not able to express a horizontal alignment for themself.
A 'div' element taking over the image style would solve that problem, but is invalid as child of a paragraph -->
<xsl:element name="p">
<xsl:apply-templates select="@draw:style-name">
<xsl:with-param name="globalData" select="$globalData"/>
</xsl:apply-templates>
<xsl:call-template name="create-image-element"> <xsl:call-template name="create-image-element">
<xsl:with-param name="globalData" select="$globalData"/> <xsl:with-param name="globalData" select="$globalData"/>
</xsl:call-template> </xsl:call-template>
</xsl:element> </xsl:when>
</xsl:otherwise> <xsl:otherwise>
</xsl:choose> <!-- images are embedded in a paragraph, but are in CSS not able to express a horizontal alignment for themself.
A 'div' element taking over the image style would solve that problem, but is invalid as child of a paragraph -->
<xsl:element name="p">
<xsl:apply-templates select="@draw:style-name">
<xsl:with-param name="globalData" select="$globalData"/>
</xsl:apply-templates>
<xsl:call-template name="create-image-element">
<xsl:with-param name="globalData" select="$globalData"/>
</xsl:call-template>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template> </xsl:template>
<xsl:template name="create-image-element"> <xsl:template name="create-image-element">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment