summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-04-27 16:47:09 +0200
committerMichael Stahl <michael.stahl@cib.de>2020-05-12 14:17:43 +0200
commit0777abafe01eb6c9ba6ed7412e44002c8018d972 (patch)
tree3304eef9b20e82456836ef3e07278552842e5f3a
parent0507ef963842191d2b34e007831a38800212f602 (diff)
filter,writerperfect: adapt XHTML,EPUB to draw:mime-type in ODF 1.3
Change-Id: I6391f7b4f0183a0193aaa10f2a41fac416a22c09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92984 Reviewed-by: Michael Stahl <michael.stahl@cib.de> Tested-by: Jenkins
-rw-r--r--filter/source/xslt/odf2xhtml/export/xhtml/body.xsl16
-rw-r--r--writerperfect/source/writer/exp/XMLTextFrameContext.cxx2
2 files changed, 15 insertions, 3 deletions
diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
index ba6bdd78f6c2..ce2a03b8499f 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
@@ -1484,8 +1484,11 @@
The replacement graphic is a png which browsers are more likely able to render than the
original graphic which might have arbitrary formats. -->
<xsl:if test="(@loext:mime-type = 'image/svg+xml') or
+ (@draw:mime-type = 'image/svg+xml') or
(not(following-sibling::draw:image) and
- not(preceding-sibling::draw:image[1]/@loext:mime-type = 'image/svg+xml'))">
+ not((preceding-sibling::draw:image[1]/@loext:mime-type = 'image/svg+xml')
+ or
+ (preceding-sibling::draw:image[1]/@draw:mime-type = 'image/svg+xml')))">
<xsl:choose>
<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">
<!-- XHTML does not allow the mapped elements to contain paragraphs -->
@@ -1551,7 +1554,16 @@
<xsl:attribute name="src">
<xsl:call-template name="create-href">
<xsl:with-param name="href" select="@xlink:href"/>
- <xsl:with-param name="mimetype" select="@loext:mime-type"/>
+ <xsl:with-param name="mimetype">
+ <xsl:choose>
+ <xsl:when test="@draw:mime-type">
+ <xsl:value-of select="@draw:mime-type"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@loext:mime-type"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
</xsl:call-template>
</xsl:attribute>
diff --git a/writerperfect/source/writer/exp/XMLTextFrameContext.cxx b/writerperfect/source/writer/exp/XMLTextFrameContext.cxx
index d6f0a3fd5c30..60cc3d87f94a 100644
--- a/writerperfect/source/writer/exp/XMLTextFrameContext.cxx
+++ b/writerperfect/source/writer/exp/XMLTextFrameContext.cxx
@@ -107,7 +107,7 @@ void XMLTextImageContext::startElement(
for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i)
{
const OUString& rAttributeName = xAttribs->getNameByIndex(i);
- if (rAttributeName == "loext:mime-type")
+ if (rAttributeName == "loext:mime-type" || rAttributeName == "draw:mime-type")
m_aMimeType = OUStringToOString(xAttribs->getValueByIndex(i), RTL_TEXTENCODING_UTF8);
}
}