Commits

Anonymous committed 4698be8

rtftok01: add support for symbol controls

Comments (0)

Files changed (4)

writerfilter/source/rtftok/RTFDestination.hxx

 
     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);

writerfilter/source/rtftok/RTFDocumentImpl.cxx

 }
 
 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)
 {

writerfilter/source/rtftok/rtfactions.xml

 <?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" /> -->
     <ref name="v" tokenid="sprm:CFVanish"/>
     <!--    <ref name="webhidden"/>-->
   </charprops>
+
   <paraprops>
     <ref name="par" action="ParagraphBreak()"/>
     <ref name="pard" action="ResetParagraphProperties()"/>
     <!-- <ref name="txbxtwfirst"/> -->
     <!-- <ref name="txbxtwlast"/> -->
   </paraprops>
+
   <sectprops>
     <ref name="sect" action="SectionBreak()"/>
     <ref name="sectd" action="ResetSectionProperties()"/>
     <!-- <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??? -->

writerfilter/source/rtftok/rtfcontrols.xsl

             </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"/>
         </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"/>
         <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>