# HG changeset patch
# User Michael Stahl <mst@openoffice.org>
# Date 1285757271 -7200
# Node ID 540365f08802418f8ade9772f88a0aefc3d206ab
# Parent  953a6f8e2290fa17c3d6ec2106f6109482175dde
rtftok01: add various underline controls and support for mapping to const values

diff --git a/writerfilter/source/rtftok/rtfactions.xml b/writerfilter/source/rtftok/rtfactions.xml
--- a/writerfilter/source/rtftok/rtfactions.xml
+++ b/writerfilter/source/rtftok/rtfactions.xml
@@ -8,9 +8,30 @@
     <ref name="fittext" tokenid="sprm:CFitText"/>
     <ref name="i" tokenid="sprm:CFItalic"/>
     <ref name="impr" tokenid="sprm:CFImprint"/>
+    <ref name="outl" tokenid="sprm:CFOutline"/>
     <ref name="scaps" tokenid="sprm:CFSmallCaps"/>
     <ref name="shad" tokenid="sprm:CFShadow"/>
     <ref name="strike" tokenid="sprm:CFStrike"/>
     <ref name="striked" tokenid="sprm:CFDStrike"/>
+    <ref name="ul" tokenid="sprm:CKul" nonzero-value="1"/>
+    <!--    <ref name="ulc" tokenid="sprm:CKul" nonzero-value="1"/>-->
+    <ref name="uld" tokenid="sprm:CKul" value="4"/> <!-- why flag??? -->
+    <ref name="uldash" tokenid="sprm:CKul" nonzero-value="7"/>
+    <ref name="uldashd" tokenid="sprm:CKul" nonzero-value="9"/>
+    <ref name="uldashdd" tokenid="sprm:CKul" nonzero-value="10"/>
+    <ref name="uldb" tokenid="sprm:CKul" nonzero-value="3"/>
+    <ref name="ulhwave" tokenid="sprm:CKul" nonzero-value="27"/>
+    <ref name="ulldash" tokenid="sprm:CKul" nonzero-value="39"/>
+    <ref name="ulnone" tokenid="sprm:CKul" value="0"/>
+    <ref name="ulth" tokenid="sprm:CKul" nonzero-value="6"/>
+    <ref name="ulthd" tokenid="sprm:CKul" nonzero-value="20"/>
+    <ref name="ulthdash" tokenid="sprm:CKul" nonzero-value="23"/>
+    <ref name="ulthdashd" tokenid="sprm:CKul" nonzero-value="25"/>
+    <ref name="ulthdashdd" tokenid="sprm:CKul" nonzero-value="26"/>
+    <ref name="ulthldash" tokenid="sprm:CKul" nonzero-value="55"/>
+    <ref name="ululdbwave" tokenid="sprm:CKul" nonzero-value="43"/>
+    <ref name="ulw" tokenid="sprm:CKul" value="2"/> <!-- why flag??? -->
+    <ref name="ulwave" tokenid="sprm:CKul" nonzero-value="11"/>
+    <ref name="v" tokenid="sprm:CFVanish"/>
   </charprops>
 </actions>
diff --git a/writerfilter/source/rtftok/rtfcontrols.xsl b/writerfilter/source/rtftok/rtfcontrols.xsl
--- a/writerfilter/source/rtftok/rtfcontrols.xsl
+++ b/writerfilter/source/rtftok/rtfcontrols.xsl
@@ -91,11 +91,38 @@
       <xsl:text>{&#xA;</xsl:text>
       <xsl:if test="@tokenid">
         <xsl:choose>
-          <xsl:when test="$type=flag">
+          <xsl:when test="$type='flag'">
+            <xsl:choose>
+              <xsl:when test="@value">
+                <xsl:text>RTFValue::Pointer_t const pValue(</xsl:text>
+                <xsl:text>new RTFValueInt(</xsl:text>
+                <xsl:value-of select="@value"/>
+                <xsl:text>)</xsl:text>
+                <xsl:text>);&#xA;</xsl:text>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:text>#error token: </xsl:text>
+                <xsl:value-of select="@name"/>
+                <xsl:text> type is:</xsl:text>
+                <xsl:value-of select="$type"/>
+                <xsl:text>&#xA;</xsl:text>
+              </xsl:otherwise>
+            </xsl:choose>
           </xsl:when>
           <xsl:when test="$type='toggle'">
             <xsl:text>sal_Int32 const n( ('\0' == *value) ? 1 : ::rtl::OString(value).toInt32() );&#xA;</xsl:text>
-            <xsl:text>RTFValue::Pointer_t const pValue(new RTFValueBool(0 != n));&#xA;</xsl:text>
+            <xsl:text>RTFValue::Pointer_t const pValue(</xsl:text>
+            <xsl:choose>
+              <xsl:when test="@nonzero-value">
+                <xsl:text>new RTFValueInt( (n == 0) ? 0 : </xsl:text>
+                <xsl:value-of select="@nonzero-value"/>
+                <xsl:text> )</xsl:text>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:text>new RTFValueBool(0 != n)</xsl:text>
+              </xsl:otherwise>
+            </xsl:choose>
+            <xsl:text>);&#xA;</xsl:text>
           </xsl:when>
           <xsl:when test="$type='value'">
             <xsl:text>sal_Int32 const n( ('\0' == *value) ? 0 : ::rtl::OString(value).toInt32() );&#xA;</xsl:text>
