[Libreoffice-commits] core.git: filter/source writerperfect/source

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Tue May 12 12:18:25 UTC 2020


 filter/source/xslt/odf2xhtml/export/xhtml/body.xsl      |   16 ++++++++++++++--
 writerperfect/source/writer/exp/XMLTextFrameContext.cxx |    2 +-
 2 files changed, 15 insertions(+), 3 deletions(-)

New commits:
commit 0777abafe01eb6c9ba6ed7412e44002c8018d972
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Mon Apr 27 16:47:09 2020 +0200
Commit:     Michael Stahl <michael.stahl at cib.de>
CommitDate: Tue May 12 14:17:43 2020 +0200

    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 at cib.de>
    Tested-by: Jenkins

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);
     }
 }


More information about the Libreoffice-commits mailing list