Kaydet (Commit) d861027a authored tarafından Robert Antoni Buj Gelonch's avatar Robert Antoni Buj Gelonch Kaydeden (comit) Andras Timar

tdf#90999: Import spreadsheetML cells with inline formatting tags

Change-Id: I5a723d5ecc4a075be64ba9766e574d9a9df50eb1
Reviewed-on: https://gerrit.libreoffice.org/15821Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarDavid Tardon <dtardon@redhat.com>
Tested-by: 's avatarDavid Tardon <dtardon@redhat.com>
üst 32b91195
...@@ -479,7 +479,7 @@ ...@@ -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[not(@ss:Name)]"/>
<xsl:apply-templates select="/ss:Workbook/ss:Styles/ss:Style/ss:Font[@ss:VerticalAlign]"/> <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 --> <!-- 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"/> <xsl:apply-templates select="/ss:Workbook/ss:Worksheet/x:WorksheetOptions/x:PageSetup//@x:Data"/>
<!-- if ConditionalFormatting exists,transforing the styles --> <!-- if ConditionalFormatting exists,transforing the styles -->
<xsl:if test="/ss:Workbook/ss:Worksheet/x:ConditionalFormatting"> <xsl:if test="/ss:Workbook/ss:Worksheet/x:ConditionalFormatting">
...@@ -6920,13 +6920,12 @@ ...@@ -6920,13 +6920,12 @@
</xsl:template> </xsl:template>
<xsl:template name="create-data-content"> <xsl:template name="create-data-content">
<xsl:param name="style-id" select="@ss:StyleID"/> <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:choose>
<xsl:when test="$html-children and $html-children != ''"> <xsl:when test="ss:Data//text()[string-length(.) != 0]">
<xsl:for-each select="$html-children"> <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())}"> <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> </text:span>
</xsl:for-each> </xsl:for-each>
</xsl:when> </xsl:when>
...@@ -7170,7 +7169,7 @@ ...@@ -7170,7 +7169,7 @@
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>
<xsl:template match="ss:Data"> <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"> <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:element name="style:text-properties">
<xsl:if test="ancestor-or-self::html:Font/@html:Face"> <xsl:if test="ancestor-or-self::html:Font/@html:Face">
......
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