# HG changeset patch
# User Henning Brinkmann <hbrinkm@openoffice.org>
# Date 1282752414 -7200
# Node ID 180275f9cb56cbb351c8beac39ae854bcbb122a8
# Parent  6c54fb8aa184c7d78cbc900719807d65ccaef54b
rtftok01: preprocess destinations

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
@@ -147,6 +147,7 @@
           </xsl:call-template>
         </xsl:when>
         <xsl:when test="starts-with($token, '(')">
+          <xsl:value-of select="$prev"/>
           <xsl:variable name="braceinner">
             <xsl:call-template name="braceinner">
               <xsl:with-param name="string" select="substring($token,2)"/>
@@ -274,6 +275,19 @@
   </xsl:choose>
 </xsl:template>
 
+<xsl:template name="preprocessdestinations">
+  <xsl:param name="string"/>
+  <xsl:choose>
+    <xsl:when test='starts-with($string, "&apos;{\*&apos; \")'>
+      <xsl:text>&apos;{&apos; \*\</xsl:text>
+      <xsl:value-of select="substring($string, 8)"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$string"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
 <xsl:template name="parseright">
   <xsl:param name="right"/>
   <xsl:param name="prev"/>
@@ -694,9 +708,17 @@
             <xsl:comment>
               <xsl:value-of select="$right"/>
             </xsl:comment>
+            <xsl:variable name="rightdestpreproc">
+              <xsl:call-template name="preprocessdestinations">
+                <xsl:with-param name="string" select="$right"/>
+              </xsl:call-template>
+            </xsl:variable>
+            <xsl:comment>
+              <xsl:value-of select="$rightdestpreproc"/>
+            </xsl:comment>            
             <xsl:variable name="rightpreprocessed">
               <xsl:call-template name="parensbyprecedence">
-                <xsl:with-param name="string" select="$right"/>
+                <xsl:with-param name="string" select="$rightdestpreproc"/>
               </xsl:call-template>
             </xsl:variable>
             <xsl:comment>
