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

Julien Nabet (via logerrit) logerrit at kemper.freedesktop.org
Wed Dec 23 08:00:28 UTC 2020


 filter/source/xslt/export/uof/odf2uof_spreadsheet.xsl |   65 +++++++++++++-----
 1 file changed, 50 insertions(+), 15 deletions(-)

New commits:
commit 1edf1871079518f90e447c3de9df0c4ef5e1e3e4
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Tue Dec 22 21:09:04 2020 +0100
Commit:     Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Wed Dec 23 08:59:51 2020 +0100

    Related tdf#139073: deal with "none" for border-width in odf2uof_spreadsheet
    
    Change-Id: I040aab5a1863b359cf343de45930127a80e28506
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108217
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>

diff --git a/filter/source/xslt/export/uof/odf2uof_spreadsheet.xsl b/filter/source/xslt/export/uof/odf2uof_spreadsheet.xsl
index f1b9955c55e6..e8bb6fa7999a 100644
--- a/filter/source/xslt/export/uof/odf2uof_spreadsheet.xsl
+++ b/filter/source/xslt/export/uof/odf2uof_spreadsheet.xsl
@@ -4328,9 +4328,16 @@
                         <xsl:attribute name="uof:locID">u0061</xsl:attribute>
                         <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
                         <xsl:variable name="border-width">
-                            <xsl:call-template name="convert2cm">
-                                <xsl:with-param name="value" select="substring-before($styleProperties/@style:diagonal-bl-tr, ' ')"/>
-                            </xsl:call-template>
+                            <xsl:choose>
+                                <xsl:when test="$styleProperties/@style:diagonal-bl-tr !='none'">
+                                    <xsl:call-template name="convert2cm">
+                                        <xsl:with-param name="value" select="substring-before($styleProperties/@style:diagonal-bl-tr, ' ')"/>
+                                    </xsl:call-template>
+                                </xsl:when>
+                                <xsl:otherwise>
+                                    <xsl:value-of select="$styleProperties/@style:diagonal-bl-tr" />
+                                </xsl:otherwise>
+                            </xsl:choose>
                         </xsl:variable>
                         <xsl:variable name="border-style" select="substring-before(substring-after($styleProperties/@style:diagonal-bl-tr, ' '), ' ')"/>
                         <xsl:variable name="border-color" select="substring-after(substring-after($styleProperties/@style:diagonal-bl-tr, ' '), ' ')"/>
@@ -4346,9 +4353,16 @@
                         <xsl:attribute name="uof:locID">u0062</xsl:attribute>
                         <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
                         <xsl:variable name="border-width">
-                            <xsl:call-template name="convert2cm">
-                                <xsl:with-param name="value" select="substring-before($styleProperties/@style:diagonal-tl-br, ' ')"/>
-                            </xsl:call-template>
+                            <xsl:choose>
+                                <xsl:when test="$styleProperties/@style:diagonal-tl-br !='none'">
+                                    <xsl:call-template name="convert2cm">
+                                        <xsl:with-param name="value" select="substring-before($styleProperties/@style:diagonal-tl-br, ' ')"/>
+                                    </xsl:call-template>
+                                </xsl:when>
+                                <xsl:otherwise>
+                                    <xsl:value-of select="$styleProperties/@style:diagonal-tl-br" />
+                                </xsl:otherwise>
+                            </xsl:choose>
                         </xsl:variable>
                         <xsl:variable name="border-style" select="substring-before(substring-after($styleProperties/@style:diagonal-tl-br, ' '), ' ')"/>
                         <xsl:variable name="border-color" select="substring-after(substring-after($styleProperties/@style:diagonal-tl-br, ' '), ' ')"/>
@@ -4441,9 +4455,16 @@
                         <xsl:attribute name="uof:locID">u0061</xsl:attribute>
                         <xsl:attribute name="attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
                         <xsl:variable name="border-width">
-                            <xsl:call-template name="convert2cm">
-                                <xsl:with-param name="value" select="substring-before($styleProperties/@style:diagonal-bl-tr, ' ')"/>
-                            </xsl:call-template>
+                            <xsl:choose>
+                                <xsl:when test="$styleProperties/@style:diagonal-bl-tr !='none'">
+                                    <xsl:call-template name="convert2cm">
+                                        <xsl:with-param name="value" select="substring-before($styleProperties/@style:diagonal-bl-tr, ' ')"/>
+                                    </xsl:call-template>
+                                </xsl:when>
+                                <xsl:otherwise>
+                                    <xsl:value-of select="$styleProperties/@style:diagonal-bl-tr" />
+                                </xsl:otherwise>
+                            </xsl:choose>
                         </xsl:variable>
                         <xsl:variable name="border-style" select="substring-before(substring-after($styleProperties/@style:diagonal-bl-tr, ' '), ' ')"/>
                         <xsl:variable name="border-color" select="substring-after(substring-after($styleProperties/@style:diagonal-bl-tr, ' '), ' ')"/>
@@ -4458,9 +4479,16 @@
                         <xsl:attribute name="uof:locID">u0062</xsl:attribute>
                         <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
                         <xsl:variable name="border-width">
-                            <xsl:call-template name="convert2cm">
-                                <xsl:with-param name="value" select="substring-before($styleProperties/@style:diagonal-tl-br, ' ')"/>
-                            </xsl:call-template>
+                            <xsl:choose>
+                                <xsl:when test="$styleProperties/@style:diagonal-tl-br !='none'">
+                                    <xsl:call-template name="convert2cm">
+                                        <xsl:with-param name="value" select="substring-before($styleProperties/@style:diagonal-tl-br, ' ')"/>
+                                    </xsl:call-template>
+                                </xsl:when>
+                                <xsl:otherwise>
+                                    <xsl:value-of select="$styleProperties/@style:diagonal-tl-br" />
+                                </xsl:otherwise>
+                            </xsl:choose>
                         </xsl:variable>
                         <xsl:variable name="border-style" select="substring-before(substring-after($styleProperties/@style:diagonal-tl-br, ' '), ' ')"/>
                         <xsl:variable name="border-color" select="substring-after(substring-after($styleProperties/@style:diagonal-tl-br, ' '), ' ')"/>
@@ -4479,9 +4507,16 @@
         <xsl:param name="border_properties"/>
         <xsl:attribute name="attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
         <xsl:variable name="border-width">
-            <xsl:call-template name="convert2cm">
-                <xsl:with-param name="value" select="substring-before($border_properties, ' ')"/>
-            </xsl:call-template>
+            <xsl:choose>
+                <xsl:when test="$border_properties !='none'">
+                    <xsl:call-template name="convert2cm">
+                        <xsl:with-param name="value" select="substring-before($border_properties, ' ')"/>
+                    </xsl:call-template>
+                </xsl:when>
+                <xsl:otherwise>
+                    <xsl:value-of select="$border_properties" />
+                </xsl:otherwise>
+            </xsl:choose>
         </xsl:variable>
         <xsl:variable name="border-style" select="substring-before(substring-after($border_properties, ' '), ' ')"/>
         <xsl:variable name="border-color" select="substring-after(substring-after($border_properties, ' '), ' ')"/>


More information about the Libreoffice-commits mailing list