# HG changeset patch
# User Michael Stahl <mst@openoffice.org>
# Date 1286900298 -7200
# Node ID 4698be8920fb74b5f3a22d155837443419d73138
# Parent  202246a6d324f432471d2b43b7b3107eeb9c7c5f
rtftok01: add support for symbol controls

diff --git a/writerfilter/source/rtftok/RTFDestination.hxx b/writerfilter/source/rtftok/RTFDestination.hxx
--- a/writerfilter/source/rtftok/RTFDestination.hxx
+++ b/writerfilter/source/rtftok/RTFDestination.hxx
@@ -317,6 +317,7 @@
 
     void SetEncodingToFont(const sal_Int32 i);
     sal_uInt32 GetColorTableEntry(const sal_Int32 i);
+    void HandleSymbol(sal_Unicode const c);
     void SetAttribute(Id const id, RTFValue::Pointer_t const& pValue);
     void SetCharacterSprm(Id const id, RTFValue::Pointer_t const& pValue);
     void SetParagraphSprm(Id const id, RTFValue::Pointer_t const& pValue);
diff --git a/writerfilter/source/rtftok/RTFDocumentImpl.cxx b/writerfilter/source/rtftok/RTFDocumentImpl.cxx
--- a/writerfilter/source/rtftok/RTFDocumentImpl.cxx
+++ b/writerfilter/source/rtftok/RTFDocumentImpl.cxx
@@ -502,11 +502,16 @@
 }
 
 sal_uInt32
-RTFDestination::GetColorTableEntry(const sal_Int32 i)
+RTFDestination::GetColorTableEntry(sal_Int32 const i)
 {
     return GetHandler().GetColorTableEntry(i);
 }
 
+void RTFDestination::HandleSymbol(sal_Unicode const c)
+{
+    GetHandler().addCharU(c);
+}
+
 void
 RTFDestination::SetAttribute(Id const id, RTFValue::Pointer_t const& pValue)
 {
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
@@ -1,5 +1,258 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <actions>
+
+  <docprops>
+    <!-- <ref name="deftab"/> -->
+    <!-- <ref name="hyphhotz"/> -->
+    <!-- <ref name="hyphconsec"/> -->
+    <!-- <ref name="hyphcaps"/> -->
+    <!-- <ref name="hyphauto"/> -->
+    <!-- <ref name="linestart"/> -->
+    <!-- <ref name="fracwidth"/> -->
+    <!-- <ref name="nextfile"/> -->
+    <!-- <ref name="template"/> -->
+    <!-- <ref name="makebackup"/> -->
+    <!-- <ref name="muser"/> -->
+    <!-- <ref name="defformat"/> -->
+    <!-- <ref name="psover"/> -->
+    <!-- <ref name="doctemp"/> -->
+    <!-- <ref name="windowcaption"/> -->
+    <!-- <ref name="doctype"/> -->
+    <!-- <ref name="ilfomacatclnup"/> -->
+    <!-- <ref name="horzdoc"/> -->
+    <!-- <ref name="vertdoc"/> -->
+    <!-- <ref name="jcompress"/> -->
+    <!-- <ref name="jexpand"/> -->
+    <!-- <ref name="lnongrid"/> -->
+    <!-- <ref name="grfdocevents"/> -->
+    <!-- <ref name="themelang"/> -->
+    <!-- <ref name="themelangfe"/> -->
+    <!-- <ref name="themelangcs"/> -->
+    <!-- <ref name="relyonvml"/> -->
+    <!-- <ref name="validatexml"/> -->
+    <!-- <ref name="xform"/> -->
+    <!-- <ref name="donotembedsysfont"/> -->
+    <!-- <ref name="donotembedlingdata"/> -->
+    <!-- <ref name="showplaceholdtext"/> -->
+    <!-- <ref name="trackmoves"/> -->
+    <!-- <ref name="trackformatting"/> -->
+    <!-- <ref name="ignoremixedcontent"/> -->
+    <!-- <ref name="saveinvalidxml"/> -->
+    <!-- <ref name="showxmlerrors"/> -->
+    <!-- <ref name="stylelocktheme"/> -->
+    <!-- <ref name="stylelockqfset"/> -->
+    <!-- <ref name="usenormstyforlist"/> -->
+    <!-- <ref name="wgrffmtfilter"/> -->
+    <!-- <ref name="readonlyrecommended"/> -->
+    <!-- <ref name="stylesortmethod"/> -->
+    <!-- <ref name="writereservhash"/> -->
+    <!-- <ref name="writereservation"/> -->
+    <!-- <ref name="saveprevpict"/> -->
+    <!-- <ref name="viewkind"/> -->
+    <!-- <ref name="viewscale"/> -->
+    <!-- <ref name="viewzk"/> -->
+    <!-- <ref name="viewbksp"/> -->
+    <!-- <ref name="private"/> -->
+    <!-- <ref name="fet"/> -->
+    <!-- <ref name="ftnsep"/> -->
+    <!-- <ref name="ftnsepc"/> -->
+    <!-- <ref name="ftncn"/> -->
+    <!-- <ref name="aftnsep"/> -->
+    <!-- <ref name="aftnsepc"/> -->
+    <!-- <ref name="aftncn"/> -->
+    <!-- <ref name="endnotes"/> -->
+    <!-- <ref name="enddoc"/> -->
+    <!-- <ref name="ftntj"/> -->
+    <!-- <ref name="ftnbj"/> -->
+    <!-- <ref name="aendnotes"/> -->
+    <!-- <ref name="aenddoc"/> -->
+    <!-- <ref name="aftnbj"/> -->
+    <!-- <ref name="aftntj"/> -->
+    <!-- <ref name="ftnstart"/> -->
+    <!-- <ref name="aftnstart"/> -->
+    <!-- <ref name="ftnrstpg"/> -->
+    <!-- <ref name="ftnrestart"/> -->
+    <!-- <ref name="ftnrstcont"/> -->
+    <!-- <ref name="aftnrestart"/> -->
+    <!-- <ref name="aftnrstcont"/> -->
+    <!-- <ref name="ftnnar"/> -->
+    <!-- <ref name="ftnnalc"/> -->
+    <!-- <ref name="ftnnauc"/> -->
+    <!-- <ref name="ftnnrlc"/> -->
+    <!-- <ref name="ftnnruc"/> -->
+    <!-- <ref name="ftnnchi"/> -->
+    <!-- <ref name="ftnnchosung"/> -->
+    <!-- <ref name="ftnncnum"/> -->
+    <!-- <ref name="ftnndbnum"/> -->
+    <!-- <ref name="ftnndbnumd"/> -->
+    <!-- <ref name="ftnndbnumt"/> -->
+    <!-- <ref name="ftnndbnumk"/> -->
+    <!-- <ref name="ftnndbar"/> -->
+    <!-- <ref name="ftnnganada"/> -->
+    <!-- <ref name="ftnngbnum"/> -->
+    <!-- <ref name="ftnngbnumd"/> -->
+    <!-- <ref name="ftnngbnuml"/> -->
+    <!-- <ref name="ftnngbnumk"/> -->
+    <!-- <ref name="ftnnzodiac"/> -->
+    <!-- <ref name="ftnnzodiacd"/> -->
+    <!-- <ref name="ftnnzodiacl"/> -->
+    <!-- <ref name="aftnnar"/> -->
+    <!-- <ref name="aftnnalc"/> -->
+    <!-- <ref name="aftnnauc"/> -->
+    <!-- <ref name="aftnnrlc"/> -->
+    <!-- <ref name="aftnnruc"/> -->
+    <!-- <ref name="aftnnchi"/> -->
+    <!-- <ref name="aftnnchosung"/> -->
+    <!-- <ref name="aftnncnum"/> -->
+    <!-- <ref name="aftnndbnum"/> -->
+    <!-- <ref name="aftnndbnumd"/> -->
+    <!-- <ref name="aftnndbnumt"/> -->
+    <!-- <ref name="aftnndbnumk"/> -->
+    <!-- <ref name="aftnndbar"/> -->
+    <!-- <ref name="aftnnganada"/> -->
+    <!-- <ref name="aftnngbnum"/> -->
+    <!-- <ref name="aftnngbnumd"/> -->
+    <!-- <ref name="aftnngbnuml"/> -->
+    <!-- <ref name="aftnngbnumk"/> -->
+    <!-- <ref name="aftnnzodiac"/> -->
+    <!-- <ref name="aftnnzodiacd"/> -->
+    <!-- <ref name="aftnnzodiacl"/> -->
+    <!-- <ref name="paperw"/> -->
+    <!-- <ref name="paperh"/> -->
+    <!-- <ref name="psz"/> -->
+    <!-- <ref name="margl"/> -->
+    <!-- <ref name="margr"/> -->
+    <!-- <ref name="margt"/> -->
+    <!-- <ref name="margb"/> -->
+    <!-- <ref name="facingp"/> -->
+    <!-- <ref name="gutter"/> -->
+    <!-- <ref name="ogutter"/> -->
+    <!-- <ref name="rtlgutter"/> -->
+    <!-- <ref name="gutterprl"/> -->
+    <!-- <ref name="margmirror"/> -->
+    <!-- <ref name="landscape"/> -->
+    <!-- <ref name="pgnstart"/> -->
+    <!-- <ref name="widowctrl"/> -->
+    <!-- <ref name="twoonone"/> -->
+    <!-- <ref name="bookfold"/> -->
+    <!-- <ref name="bookfoldrev"/> -->
+    <!-- <ref name="bookfoldsheets"/> -->
+    <!-- <ref name="linkstyles"/> -->
+    <!-- <ref name="notabind"/> -->
+    <!-- <ref name="wraptrsp"/> -->
+    <!-- <ref name="prcolbl"/> -->
+    <!-- <ref name="noextrasprl"/> -->
+    <!-- <ref name="nocolbal"/> -->
+    <!-- <ref name="cvmme"/> -->
+    <!-- <ref name="sprstsp"/> -->
+    <!-- <ref name="sprsspbf"/> -->
+    <!-- <ref name="otblrul"/> -->
+    <!-- <ref name="transmf"/> -->
+    <!-- <ref name="swpbdr"/> -->
+    <!-- <ref name="brkfrm"/> -->
+    <!-- <ref name="sprslnsp"/> -->
+    <!-- <ref name="subfontbysize"/> -->
+    <!-- <ref name="truncatefontheight"/> -->
+    <!-- <ref name="truncex"/> -->
+    <!-- <ref name="bdbfhdr"/> -->
+    <!-- <ref name="dntblnsbdb"/> -->
+    <!-- <ref name="expshrtn"/> -->
+    <!-- <ref name="lytexcttp"/> -->
+    <!-- <ref name="lytprtmet"/> -->
+    <!-- <ref name="msmcap"/> -->
+    <!-- <ref name="nolead"/> -->
+    <!-- <ref name="nospaceforul"/> -->
+    <!-- <ref name="noultrlspc"/> -->
+    <!-- <ref name="noxlattoyen"/> -->
+    <!-- <ref name="oldlinewrap"/> -->
+    <!-- <ref name="sprsbsp"/> -->
+    <!-- <ref name="sprstsm"/> -->
+    <!-- <ref name="wpjst"/> -->
+    <!-- <ref name="wpsp"/> -->
+    <!-- <ref name="wptab"/> -->
+    <!-- <ref name="splytwnine"/> -->
+    <!-- <ref name="ftnlytwnine"/> -->
+    <!-- <ref name="htmautsp"/> -->
+    <!-- <ref name="useltbaln"/> -->
+    <!-- <ref name="alntblind"/> -->
+    <!-- <ref name="lytcalctblwd"/> -->
+    <!-- <ref name="lyttblrtgr"/> -->
+    <!-- <ref name="oldas"/> -->
+    <!-- <ref name="lnbrkrule"/> -->
+    <!-- <ref name="bdrrlswsix"/> -->
+    <!-- <ref name="nolnhtadjtbl"/> -->
+    <!-- <ref name="ApplyBrkRules"/> -->
+    <!-- <ref name="rempersonalinfo"/> -->
+    <!-- <ref name="remdttm"/> -->
+    <!-- <ref name="snaptogridincell"/> -->
+    <!-- <ref name="wrppunct"/> -->
+    <!-- <ref name="asianbrkrule"/> -->
+    <!-- <ref name="nobrkwrptbl"/> -->
+    <!-- <ref name="toplinepunct"/> -->
+    <!-- <ref name="viewnobound"/> -->
+    <!-- <ref name="donotshowmarkup"/> -->
+    <!-- <ref name="donotshowcomments"/> -->
+    <!-- <ref name="donotshowinsdel"/> -->
+    <!-- <ref name="donotshowprops"/> -->
+    <!-- <ref name="allowfieldendsel"/> -->
+    <!-- <ref name="nocompatoptions"/> -->
+    <!-- <ref name="nogrowautofit"/> -->
+    <!-- <ref name="newtblstyruls"/> -->
+    <!-- <ref name="background"/> -->
+    <!-- <ref name="nouicompat"/> -->
+    <!-- <ref name="nofeaturethrottle"/> -->
+    <!-- <ref name="forceupgrade"/> -->
+    <!-- <ref name="noafcnsttbl"/> -->
+    <!-- <ref name="noindnmbrts"/> -->
+    <!-- <ref name="felnbrelev"/> -->
+    <!-- <ref name="indrlsweleven"/> -->
+    <!-- <ref name="nocxsptable"/> -->
+    <!-- <ref name="notcvasp"/> -->
+    <!-- <ref name="notvatxbx"/> -->
+    <!-- <ref name="spltpgpar"/> -->
+    <!-- <ref name="hwelev"/> -->
+    <!-- <ref name="afelev"/> -->
+    <!-- <ref name="cachedcolbal"/> -->
+    <!-- <ref name="utinl"/> -->
+    <!-- <ref name="notbrkcnstfrctbl"/> -->
+    <!-- <ref name="krnprsnet"/> -->
+    <!-- <ref name="usexform"/> -->
+    <!-- <ref name="formprot"/> -->
+    <!-- <ref name="allprot"/> -->
+    <!-- <ref name="formshade"/> -->
+    <!-- <ref name="formdisp"/> -->
+    <!-- <ref name="printdata"/> -->
+    <!-- <ref name="revprot"/> -->
+    <!-- <ref name="revisions"/> -->
+    <!-- <ref name="revprop"/> -->
+    <!-- <ref name="revbar"/> -->
+    <!-- <ref name="readprot"/> -->
+    <!-- <ref name="annotprot"/> -->
+    <!-- <ref name="stylelock"/> -->
+    <!-- <ref name="stylelockenforced"/> -->
+    <!-- <ref name="stylelockbackcomp"/> -->
+    <!-- <ref name="autofmtoverride"/> -->
+    <!-- <ref name="enforceprot"/> -->
+    <!-- <ref name="protlevel"/> -->
+    <!-- <ref name="tsd"/> -->
+    <!-- <ref name="rtldoc"/> -->
+    <!-- <ref name="ltrdoc"/> -->
+    <!-- <ref name="cts"/> -->
+    <!-- <ref name="jsksu"/> -->
+    <!-- <ref name="ksulang"/> -->
+    <!-- <ref name="fchars"/> -->
+    <!-- <ref name="lchars"/> -->
+    <!-- <ref name="nojkernpunct"/> -->
+    <!-- <ref name="dghspace"/> -->
+    <!-- <ref name="dgvspace"/> -->
+    <!-- <ref name="dghorigin"/> -->
+    <!-- <ref name="dgvorigin"/> -->
+    <!-- <ref name="dghshow"/> -->
+    <!-- <ref name="dgvshow"/> -->
+    <!-- <ref name="dgsnap"/> -->
+    <!-- <ref name="dgmargin"/> -->
+  </docprops>
+
   <charprops>
     <ref name="plain" action="ResetCharacterProperties()"/>
     <!--    <ref name="accnone" /> -->
@@ -68,6 +321,7 @@
     <ref name="v" tokenid="sprm:CFVanish"/>
     <!--    <ref name="webhidden"/>-->
   </charprops>
+
   <paraprops>
     <ref name="par" action="ParagraphBreak()"/>
     <ref name="pard" action="ResetParagraphProperties()"/>
@@ -148,6 +402,7 @@
     <!-- <ref name="txbxtwfirst"/> -->
     <!-- <ref name="txbxtwlast"/> -->
   </paraprops>
+
   <sectprops>
     <ref name="sect" action="SectionBreak()"/>
     <ref name="sectd" action="ResetSectionProperties()"/>
@@ -309,5 +564,57 @@
     <!-- <ref name="sectspecifyl"/> -->
     <!-- <ref name="sectspecifygen"/> -->
   </sectprops>
+
+  <special>
+    <!-- <ref name="chdate"/> -->
+    <!-- <ref name="chdpl"/> -->
+    <!-- <ref name="chdpa"/> -->
+    <!-- <ref name="chtime"/> -->
+    <!-- <ref name="chpgn"/> -->
+    <!-- <ref name="sectnum"/> -->
+    <!-- <ref name="chftn"/> -->
+    <!-- <ref name="chatn"/> -->
+    <!-- <ref name="chftnsep"/> -->
+    <!-- <ref name="chftnsepc"/> -->
+    <!-- <ref name="cell"/> -->
+    <!-- <ref name="nestcell"/> -->
+    <!-- <ref name="row"/> -->
+    <!-- <ref name="nestrow"/> -->
+    <!-- <ref name="par"/> -->
+    <!-- <ref name="sect"/> -->
+    <!-- <ref name="page"/> -->
+    <!-- <ref name="column"/> -->
+    <ref name="line" char="0x0A"/>
+    <!-- <ref name="lbr"/> -->
+    <!-- <ref name="softpage"/> -->
+    <!-- <ref name="softcol"/> -->
+    <!-- <ref name="softline"/> -->
+    <!-- <ref name="softlheight"/> -->
+    <ref name="tab" char="0x07"/>
+    <ref name="emdash" char="0x2014"/>
+    <ref name="endash" char="0x2013"/>
+    <ref name="emspace" char="0x2003"/>
+    <ref name="enspace" char="0x2002"/>
+    <ref name="qmspace" char="0x2005"/>
+    <ref name="bullet" char="0x2022"/>
+    <ref name="lquote" char="0x2018"/>
+    <ref name="rquote" char="0x2019"/>
+    <ref name="ldblquote" char="0x201C"/>
+    <ref name="rdblquote" char="0x201D"/>
+    <!-- <ref name="|"/> -->
+    <!-- <ref name="~"/> -->
+    <!-- <ref name="-"/> -->
+    <!-- <ref name="_"/> -->
+    <!-- <ref name=":"/> -->
+    <!-- <ref name="*"/> -->
+    <!-- <ref name="'hh"/> -->
+    <ref name="ltrmark" char="0x200E"/>
+    <ref name="rtlmark" char="0x200F"/>
+    <ref name="zwbo" char="0x200B"/>
+    <ref name="zwnbo" char="0x2060"/>
+    <ref name="zwj" char="0x200D"/>
+    <ref name="zwnj" char="0x200C"/>
+  </special>
+
 </actions>
     <!--    <ref name="updnprops" tokenid="sprm:CHpsPos"/> destination??? -->
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
@@ -107,6 +107,8 @@
             </xsl:otherwise>
           </xsl:choose>
         </xsl:when>
+        <!-- <xsl:when test="$type='symbol'">
+        </xsl:when> -->
         <xsl:otherwise>
           <xsl:text>#error token: </xsl:text>
           <xsl:value-of select="@name"/>
@@ -142,6 +144,12 @@
         </xsl:otherwise>
       </xsl:choose>
     </xsl:if>
+    <xsl:if test="@char">
+      <xsl:text>sal_Unicode const c( </xsl:text>
+      <xsl:value-of select="@char"/>
+      <xsl:text> );&#xA;</xsl:text>
+      <xsl:text>rDestination.HandleSymbol(c);&#xA;</xsl:text>
+    </xsl:if>
     <xsl:if test="@action">
       <xsl:text>rDestination.</xsl:text>
       <xsl:value-of select="@action"/>
@@ -202,6 +210,11 @@
         <xsl:with-param name="kind">section</xsl:with-param>
       </xsl:call-template>
     </xsl:for-each>
+    <xsl:for-each select="document('rtfactions.xml')/actions/special/ref">
+      <xsl:call-template name="handle-case">
+        <xsl:with-param name="kind">special</xsl:with-param>
+      </xsl:call-template>
+    </xsl:for-each>
 
 
 
