diff options
author | Robert Antoni Buj Gelonch <robert.buj@gmail.com> | 2015-05-20 23:31:46 +0200 |
---|---|---|
committer | Adolfo Jayme Barrientos <fitojb@ubuntu.com> | 2015-05-21 13:22:15 +0000 |
commit | 26c6602c9036e12e0d228b6f5377f47fde5a530f (patch) | |
tree | 51800b39a0a4643f0c217972be945f74740f582f | |
parent | d276993a1b60f66ce4322c29709c0c3907977663 (diff) |
tdf#90999: Import spreadsheetML cells with inline formatting tags
Change-Id: Icb906a7944097d2cc92addc0e85be08f089a23e4
Reviewed-on: https://gerrit.libreoffice.org/15833
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Tested-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
-rw-r--r-- | filter/source/xslt/import/spreadsheetml/spreadsheetml2ooo.xsl | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/filter/source/xslt/import/spreadsheetml/spreadsheetml2ooo.xsl b/filter/source/xslt/import/spreadsheetml/spreadsheetml2ooo.xsl index a5875c2068b9..09d1270c8cee 100644 --- a/filter/source/xslt/import/spreadsheetml/spreadsheetml2ooo.xsl +++ b/filter/source/xslt/import/spreadsheetml/spreadsheetml2ooo.xsl @@ -479,7 +479,7 @@ <xsl:apply-templates select="/ss:Workbook/ss:Styles/ss:Style[not(@ss:Name)]"/> <xsl:apply-templates select="/ss:Workbook/ss:Styles/ss:Style/ss:Font[@ss:VerticalAlign]"/> <!-- applying to ss:Data (but *, as also ss:Data nested in ss:Comments --> - <xsl:apply-templates select="/ss:Workbook/ss:Worksheet/ss:Table/ss:Row/ss:Cell/*[descendant-or-self::*[namespace-uri()='http://www.w3.org/TR/REC-html40']]"/> + <xsl:apply-templates select="/ss:Workbook/ss:Worksheet/ss:Table/ss:Row/ss:Cell/*[descendant-or-self::*]"/> <xsl:apply-templates select="/ss:Workbook/ss:Worksheet/x:WorksheetOptions/x:PageSetup//@x:Data"/> <!-- if ConditionalFormatting exists,transforing the styles --> <xsl:if test="/ss:Workbook/ss:Worksheet/x:ConditionalFormatting"> @@ -6920,13 +6920,12 @@ </xsl:template> <xsl:template name="create-data-content"> <xsl:param name="style-id" select="@ss:StyleID"/> - <!-- collect every HTML 3.2 children, which are not empty --> - <xsl:variable name="html-children" select="ss:Data/descendant-or-self::*[namespace-uri()='http://www.w3.org/TR/REC-html40'][string-length(text()) != 0]"/> <xsl:choose> - <xsl:when test="$html-children and $html-children != ''"> - <xsl:for-each select="$html-children"> + <xsl:when test="ss:Data//text()[string-length(.) != 0]"> + <xsl:for-each select="ss:Data//text()[string-length(.) != 0]"> + <xsl:sort select="position( )" order="ascending" data-type="number"/> <text:span text:style-name="{concat($style-id, 'T', count(preceding::ss:Data[child::html:*]), '_', position())}"> - <xsl:copy-of select="text()"/> + <xsl:value-of select="."/> </text:span> </xsl:for-each> </xsl:when> @@ -7170,7 +7169,7 @@ </xsl:if> </xsl:template> <xsl:template match="ss:Data"> - <xsl:for-each select="descendant-or-self::*[namespace-uri()='http://www.w3.org/TR/REC-html40'][string-length(text()) != 0]"> + <xsl:for-each select=".//text()[string-length(.) != 0]"> <style:style style:name="{concat(ancestor::ss:Cell/@ss:StyleID,'T',count(preceding::ss:Data[child::html:*]), '_', position())}" style:family="text"> <xsl:element name="style:text-properties"> <xsl:if test="ancestor-or-self::html:Font/@html:Face"> |