# HG changeset patch
# User Michael Stahl <mst@openoffice.org>
# Date 1284995042 -7200
# Node ID 25e9f4025104892ee9f34d624b548b98fdb8b700
# Parent  9a9d0228cb600cfd86fdd7a20422d02ed291825f
rtftok01: spectobnf.xsl: handle stars in chrfmtetc

diff --git a/writerfilter/source/rtftok/spectobnf.xsl b/writerfilter/source/rtftok/spectobnf.xsl
--- a/writerfilter/source/rtftok/spectobnf.xsl
+++ b/writerfilter/source/rtftok/spectobnf.xsl
@@ -586,7 +586,7 @@
             <xsl:if test="not(w:trPr/w:tblHeader)">
               <xsl:for-each select="w:tc[1]">
                 <xsl:for-each select="w:p">
-                  <xsl:variable name="destarred">
+                  <xsl:variable name="traildestarred">
                     <xsl:call-template name="removetrailing">
                       <xsl:with-param name="string">
                         <xsl:call-template name="removetrailing">
@@ -597,6 +597,18 @@
                       <xsl:with-param name="tail">*</xsl:with-param>
                     </xsl:call-template>
                   </xsl:variable>
+                  <xsl:variable name="destarred">
+                    <xsl:choose>
+                      <!-- first an ugly special case -->
+                      <xsl:when test="text() = '\*'">\*</xsl:when>
+                      <xsl:when test="starts-with($traildestarred, '\*\')">
+                        <xsl:value-of select="substring($traildestarred, 3)"/>
+                      </xsl:when>
+                      <xsl:otherwise>
+                        <xsl:value-of select="$traildestarred"/>
+                      </xsl:otherwise>
+                    </xsl:choose>
+                  </xsl:variable>
                   <xsl:if test="substring($destarred, 1, 1) = '\'">
                     <xsl:call-template name="tokentoelement">
                       <xsl:with-param name="token" select="substring($destarred, 2)"/>
