Exemplo n.º 1
0
 /**
  *
  */
 protected RtfCtrlWordData AfterCtrlWord(RtfCtrlWordData ctrlWordData)
 {
     foreach (IRtfDestinationListener listener in listeners)
     {
         listener.AfterCtrlWord(ctrlWordData);
     }
     return(null);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Set the value of the property identified by the parameter.
        /// </summary>
        /// <param name="ctrlWordData">The controlword with the name to set</param>
        /// <returns> true  for handled or  false  if  propertyName  or  propertyValue  is  null </returns>
        public bool SetProperty(RtfCtrlWordData ctrlWordData)
        { //String propertyName, Object propertyValueNew) {
            var    propertyName     = ctrlWordData.SpecialHandler;
            object propertyValueNew = ctrlWordData.Param;

            // depending on the control word, set mulitiple or reset settings, etc.
            //if pard then reset settings
            //
            setProperty(propertyName, propertyValueNew);
            return(true);
        }
        public override bool HandleControlWord(RtfCtrlWordData ctrlWordData)
        {
            if (ctrlWordData.CtrlWord.Equals("blue"))
            {
                setBlue(ctrlWordData.IntValue());
            }

            if (ctrlWordData.CtrlWord.Equals("red"))
            {
                setRed(ctrlWordData.IntValue());
            }

            if (ctrlWordData.CtrlWord.Equals("green"))
            {
                setGreen(ctrlWordData.IntValue());
            }

            if (ctrlWordData.CtrlWord.Equals("cshade"))
            {
                setShade(ctrlWordData.IntValue());
            }

            if (ctrlWordData.CtrlWord.Equals("ctint"))
            {
                setTint(ctrlWordData.IntValue());
            }
            //if(ctrlWordData.ctrlWord.Equals("cmaindarkone")) this.SetThemeColor(ctrlWordData.ctrlWord);
            //if(ctrlWordData.ctrlWord.Equals("cmainlightone")) this.SetThemeColor(ctrlWordData.ctrlWord);
            //if(ctrlWordData.ctrlWord.Equals("cmaindarktwo")) this.SetThemeColor(ctrlWordData.ctrlWord);
            //if(ctrlWordData.ctrlWord.Equals("cmainlighttwo")) this.SetThemeColor(ctrlWordData.ctrlWord);
            //if(ctrlWordData.ctrlWord.Equals("caccentone")) this.SetThemeColor(ctrlWordData.ctrlWord);
            //if(ctrlWordData.ctrlWord.Equals("caccenttwo")) this.SetThemeColor(ctrlWordData.ctrlWord);
            //if(ctrlWordData.ctrlWord.Equals("caccentthree")) this.SetThemeColor(ctrlWordData.ctrlWord);
            //if(ctrlWordData.ctrlWord.Equals("caccentfour")) this.SetThemeColor(ctrlWordData.ctrlWord);
            //if(ctrlWordData.ctrlWord.Equals("caccentfive")) this.SetThemeColor(ctrlWordData.ctrlWord);
            //if(ctrlWordData.ctrlWord.Equals("caccentsix")) this.SetThemeColor(ctrlWordData.ctrlWord);
            //if(ctrlWordData.ctrlWord.Equals("chyperlink")) this.SetThemeColor(ctrlWordData.ctrlWord);
            //if(ctrlWordData.ctrlWord.Equals("cfollowedhyperlink")) this.SetThemeColor(ctrlWordData.ctrlWord);
            //if(ctrlWordData.ctrlWord.Equals("cbackgroundone")) this.SetThemeColor(ctrlWordData.ctrlWord);
            //if(ctrlWordData.ctrlWord.Equals("ctextone")) this.SetThemeColor(ctrlWordData.ctrlWord);
            //if(ctrlWordData.ctrlWord.Equals("cbacgroundtwo")) this.SetThemeColor(ctrlWordData.ctrlWord);
            //if(ctrlWordData.ctrlWord.Equals("ctexttwo")) this.SetThemeColor(ctrlWordData.ctrlWord);
            return(true);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Toggle the value of the property identified by the  RtfCtrlWordData.specialHandler  parameter.
        /// Toggle values are assumed to be integer values per the RTF spec with a value of 0=off or 1=on.
        /// </summary>
        /// <param name="ctrlWordData">The property name to set</param>
        /// <returns> true  for handled or  false  if  propertyName  is  null  or <i>blank</i></returns>
        public bool ToggleProperty(RtfCtrlWordData ctrlWordData)
        { //String propertyName) {
            var propertyName = ctrlWordData.SpecialHandler;

            if (string.IsNullOrEmpty(propertyName))
            {
                return(false);
            }

            var propertyValue = GetProperty(propertyName);

            if (propertyValue == null)
            {
                propertyValue = ON;
            }
            else
            {
                if (propertyValue is int)
                {
                    var value = (int)propertyValue;
                    if (value != 0)
                    {
                        removeProperty(propertyName);
                    }
                    return(true);
                }
                else
                {
                    if (propertyValue is long)
                    {
                        var value = (long)propertyValue;
                        if (value != 0)
                        {
                            removeProperty(propertyName);
                        }
                        return(true);
                    }
                }
            }
            setProperty(propertyName, propertyValue);
            return(true);
        }
        /**
         * Toggle the value of the property identified by the <code>RtfCtrlWordData.specialHandler</code> parameter.
         * Toggle values are assumed to be integer values per the RTF spec with a value of 0=off or 1=on.
         *
         * @param ctrlWordData The property name to set
         * @return <code>true</code> for handled or <code>false</code> if <code>propertyName</code> is <code>null</code> or <i>blank</i>
         */
        public bool ToggleProperty(RtfCtrlWordData ctrlWordData)   //String propertyName) {
        {
            String propertyName = ctrlWordData.specialHandler;

            if (propertyName == null || propertyName.Length == 0)
            {
                return(false);
            }

            Object propertyValue = GetProperty(propertyName);

            if (propertyValue == null)
            {
                propertyValue = RtfProperty.ON;
            }
            else
            {
                if (propertyValue is int)
                {
                    int value = (int)propertyValue;
                    if (value != 0)
                    {
                        RemoveProperty(propertyName);
                    }
                    return(true);
                }
                else
                {
                    if (propertyValue is long)
                    {
                        long value = (long)propertyValue;
                        if (value != 0)
                        {
                            RemoveProperty(propertyName);
                        }
                        return(true);
                    }
                }
            }
            SetProperty(propertyName, propertyValue);
            return(true);
        }
Exemplo n.º 6
0
        public override bool HandleControlWord(RtfCtrlWordData ctrlWordData)
        {
            bool result       = true;
            bool skipCtrlWord = false;

            if (this.rtfParser.IsImport())
            {
                skipCtrlWord = true;
                if (ctrlWordData.ctrlWord.Equals("listtable"))
                {
                    result = true;
                    this.currentListMappingNumber = 0;
                }
                else
                /* Picture info for icons/images for lists */
                if (ctrlWordData.ctrlWord.Equals("listpicture"))    /* DESTINATION */
                {
                    skipCtrlWord = true;
                    // this.rtfParser.SetTokeniserStateSkipGroup();
                    result = true;
                }
                else
                /* list */
                if (ctrlWordData.ctrlWord.Equals("list"))     /* DESTINATION */
                {
                    skipCtrlWord = true;
                    this.newList = new RtfList(this.rtfParser.GetRtfDocument());
                    this.newList.SetListType(RtfList.LIST_TYPE_NORMAL); // set default
                    this.currentLevel = -1;
                    this.currentListMappingNumber++;
                    this.currentSubGroupCount = 0;
                    result = true;
                }
                else if (ctrlWordData.ctrlWord.Equals("listtemplateid"))   /* // List item*/
                {
                    // ignore this because it gets regenerated in every document
                    skipCtrlWord = true;
                    result       = true;
                }
                else if (ctrlWordData.ctrlWord.Equals("listsimple"))   /* // List item*/
                {
                    // is value 0 or 1
                    if (ctrlWordData.hasParam && ctrlWordData.param == "1")
                    {
                        this.newList.SetListType(RtfList.LIST_TYPE_SIMPLE);
                    }
                    else
                    {
                        this.newList.SetListType(RtfList.LIST_TYPE_NORMAL);
                    }
                    skipCtrlWord = true;
                    result       = true;
                    // this gets set internally. Don't think it should be imported
                }
                else if (ctrlWordData.ctrlWord.Equals("listhybrid"))   /* // List item*/
                {
                    this.newList.SetListType(RtfList.LIST_TYPE_HYBRID);
                    skipCtrlWord = true;
                    result       = true;
                    // this gets set internally. Don't think it should be imported
                }
                else if (ctrlWordData.ctrlWord.Equals("listrestarthdn"))   /* // List item*/
                {
                    skipCtrlWord = true;
                    result       = true;
                }
                else if (ctrlWordData.ctrlWord.Equals("listid"))        // List item cannot be between -1 and -5
                // needs to be mapped for imports and is recreated
                // we have the new id and the old id. Just add it to the mapping table here.
                {
                    skipCtrlWord = true;
                    result       = true;
                }
                else if (ctrlWordData.ctrlWord.Equals("listname"))  /* // List item*/
                {
                    this.newList.SetName(ctrlWordData.param);
                    skipCtrlWord = true;
                    result       = true;
                }
                else if (ctrlWordData.ctrlWord.Equals("liststyleid"))  /* // List item*/
                {
                    skipCtrlWord = true;
                    result       = true;
                }
                else if (ctrlWordData.ctrlWord.Equals("liststylename"))  /* // List item*/
                {
                    skipCtrlWord = true;
                    result       = true;
                }
                else
                /* listlevel */
                if (ctrlWordData.ctrlWord.Equals("listlevel"))     /* DESTINATION There are 1 or 9 listlevels per list */
                {
                    this.currentLevel++;
                    this.currentListLevel = this.newList.GetListLevel(this.currentLevel);
                    this.currentListLevel.SetTentative(false);
                    skipCtrlWord = true;
                    result       = true;
                }
                else if (ctrlWordData.ctrlWord.Equals("leveljc"))     // listlevel item justify
                // this is the old number. Only use it if the current type is not set
                {
                    if (this.currentListLevel.GetAlignment() == RtfListLevel.LIST_TYPE_UNKNOWN)
                    {
                        switch (ctrlWordData.IntValue())
                        {
                        case 0:
                            this.currentListLevel.SetAlignment(Element.ALIGN_LEFT);
                            break;

                        case 1:
                            this.currentListLevel.SetAlignment(Element.ALIGN_CENTER);
                            break;

                        case 2:
                            this.currentListLevel.SetAlignment(Element.ALIGN_RIGHT);
                            break;
                        }
                    }
                    skipCtrlWord = true;
                    result       = true;
                }
                else if (ctrlWordData.ctrlWord.Equals("leveljcn"))     // listlevel item
                //justify
                // if this exists, use it and it overrides the old setting
                {
                    switch (ctrlWordData.IntValue())
                    {
                    case 0:
                        this.currentListLevel.SetAlignment(Element.ALIGN_LEFT);
                        break;

                    case 1:
                        this.currentListLevel.SetAlignment(Element.ALIGN_CENTER);
                        break;

                    case 2:
                        this.currentListLevel.SetAlignment(Element.ALIGN_RIGHT);
                        break;
                    }
                    skipCtrlWord = true;
                    result       = true;
                }
                else if (ctrlWordData.ctrlWord.Equals("levelstartat"))
                {
                    this.currentListLevel.SetListStartAt(ctrlWordData.IntValue());
                    skipCtrlWord = true;
                    result       = true;
                }
                else if (ctrlWordData.ctrlWord.Equals("lvltentative"))
                {
                    this.currentListLevel.SetTentative(true);
                    skipCtrlWord = true;
                    result       = true;
                }
                else if (ctrlWordData.ctrlWord.Equals("levelold"))
                {
                    // old style. ignore
                    skipCtrlWord = true;
                    result       = true;
                }
                else if (ctrlWordData.ctrlWord.Equals("levelprev"))
                {
                    // old style. ignore
                    skipCtrlWord = true;
                    result       = true;
                }
                else if (ctrlWordData.ctrlWord.Equals("levelprevspace"))
                {
                    // old style. ignore
                    skipCtrlWord = true;
                    result       = true;
                }
                else if (ctrlWordData.ctrlWord.Equals("levelspace"))
                {
                    skipCtrlWord = true;
                    result       = true;
                }
                else if (ctrlWordData.ctrlWord.Equals("levelindent"))
                {
                    skipCtrlWord = true;
                    result       = true;
                }
                else if (ctrlWordData.ctrlWord.Equals("leveltext"))    /* FIX */
                {
                    skipCtrlWord = true;
                    result       = true;
                }
                else if (ctrlWordData.ctrlWord.Equals("levelfollow"))
                {
                    this.currentListLevel.SetLevelFollowValue(ctrlWordData.IntValue());
                    skipCtrlWord = true;
                    result       = true;
                }
                else if (ctrlWordData.ctrlWord.Equals("levellegal"))
                {
                    this.currentListLevel.SetLegal(ctrlWordData.param == "1"?true:false);
                    skipCtrlWord = true;
                    result       = true;
                }
                else if (ctrlWordData.ctrlWord.Equals("levelnorestart"))
                {
                    skipCtrlWord = true;
                    result       = true;
                }
                else if (ctrlWordData.ctrlWord.Equals("chrfmt"))    /* FIX */
                // set an attribute pair
                {
                    skipCtrlWord = true;
                    result       = true;
                }
                else if (ctrlWordData.ctrlWord.Equals("levelpicture"))
                {
                    skipCtrlWord = true;
                    result       = true;
                }
                else if (ctrlWordData.ctrlWord.Equals("li"))
                {
                    // set an attribute pair
                    skipCtrlWord = true;
                    result       = true;
                }
                else if (ctrlWordData.ctrlWord.Equals("fi"))
                {
                    // set an attribute pair
                    skipCtrlWord = true;
                    result       = true;
                }
                else if (ctrlWordData.ctrlWord.Equals("jclisttab"))
                {
                    // set an attribute pair
                    skipCtrlWord = true;
                    result       = true;
                }
                else if (ctrlWordData.ctrlWord.Equals("tx"))
                {
                    // set an attribute pair
                    skipCtrlWord = true;
                    result       = true;
                }
                else
                /* number */
                if (ctrlWordData.ctrlWord.Equals("levelnfc"))     /* old style */
                {
                    if (this.currentListLevel.GetListType() == RtfListLevel.LIST_TYPE_UNKNOWN)
                    {
                        this.currentListLevel.SetListType(ctrlWordData.IntValue() + RtfListLevel.LIST_TYPE_BASE);
                    }
                    skipCtrlWord = true;
                    result       = true;
                }
                else if (ctrlWordData.ctrlWord.Equals("levelnfcn"))   /* new style takes priority over levelnfc.*/
                {
                    this.currentListLevel.SetListType(ctrlWordData.IntValue() + RtfListLevel.LIST_TYPE_BASE);
                    skipCtrlWord = true;
                    result       = true;
                }
                else
                /* level text */
                if (ctrlWordData.ctrlWord.Equals("leveltemplateid"))
                {
                    // ignore. this value is regenerated in each document.
                    skipCtrlWord = true;
                    result       = true;
                }
                else
                /* levelnumber */
                if (ctrlWordData.ctrlWord.Equals("levelnumbers"))
                {
                    skipCtrlWord = true;
                    result       = true;
                }
            }

            if (this.rtfParser.IsConvert())
            {
                if (ctrlWordData.ctrlWord.Equals("shppict"))
                {
                    result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("nonshppict"))
                {
                    skipCtrlWord = true;
                    this.rtfParser.SetTokeniserStateSkipGroup();
                    result = true;
                }
            }
            if (!skipCtrlWord)
            {
                switch (this.rtfParser.GetConversionType())
                {
                case RtfParser.TYPE_IMPORT_FULL:
                    // WriteBuffer();
                    // WriteText(ctrlWordData.ToString());
                    result = true;
                    break;

                case RtfParser.TYPE_IMPORT_FRAGMENT:
                    // WriteBuffer();
                    // WriteText(ctrlWordData.ToString());
                    result = true;
                    break;

                case RtfParser.TYPE_CONVERT:
                    result = true;
                    break;

                default:     // error because is should be an import or convert
                    result = false;
                    break;
                }
            }

            return(result);
        }
        public override bool HandleControlWord(RtfCtrlWordData ctrlWordData)
        {
            bool result = false;
            OnCtrlWord(ctrlWordData);  // event handler

            if (RtfParser.IsImport())
            {
                // map font information
                if (ctrlWordData.CtrlWord.Equals("f")) { ctrlWordData.Param = RtfParser.GetImportManager().MapFontNr(ctrlWordData.Param); }

                // map color information
                //colors
                if (ctrlWordData.CtrlWord.Equals("cb")) { ctrlWordData.Param = RtfParser.GetImportManager().MapColorNr(ctrlWordData.Param); }
                if (ctrlWordData.CtrlWord.Equals("cf")) { ctrlWordData.Param = RtfParser.GetImportManager().MapColorNr(ctrlWordData.Param); }
                //cells
                if (ctrlWordData.CtrlWord.Equals("clcbpat")) { ctrlWordData.Param = RtfParser.GetImportManager().MapColorNr(ctrlWordData.Param); }
                if (ctrlWordData.CtrlWord.Equals("clcbpatraw")) { ctrlWordData.Param = RtfParser.GetImportManager().MapColorNr(ctrlWordData.Param); }
                if (ctrlWordData.CtrlWord.Equals("clcfpat")) { ctrlWordData.Param = RtfParser.GetImportManager().MapColorNr(ctrlWordData.Param); }
                if (ctrlWordData.CtrlWord.Equals("clcfpatraw")) { ctrlWordData.Param = RtfParser.GetImportManager().MapColorNr(ctrlWordData.Param); }
                //table rows
                if (ctrlWordData.CtrlWord.Equals("trcfpat")) { ctrlWordData.Param = RtfParser.GetImportManager().MapColorNr(ctrlWordData.Param); }
                if (ctrlWordData.CtrlWord.Equals("trcbpat")) { ctrlWordData.Param = RtfParser.GetImportManager().MapColorNr(ctrlWordData.Param); }
                //paragraph border
                if (ctrlWordData.CtrlWord.Equals("brdrcf")) { ctrlWordData.Param = RtfParser.GetImportManager().MapColorNr(ctrlWordData.Param); }
                // map lists
                if (ctrlWordData.CtrlWord.Equals("ls")) { ctrlWordData.Param = RtfParser.GetImportManager().MapListNr(ctrlWordData.Param); }
            }



            if (RtfParser.IsConvert())
            {
                if (ctrlWordData.CtrlWord.Equals("par")) { addParagraphToDocument(); }
                // Set Font
                if (ctrlWordData.CtrlWord.Equals("f")) { }

                // color information
                //colors
                if (ctrlWordData.CtrlWord.Equals("cb")) { }
                if (ctrlWordData.CtrlWord.Equals("cf")) { }
                //cells
                if (ctrlWordData.CtrlWord.Equals("clcbpat")) { }
                if (ctrlWordData.CtrlWord.Equals("clcbpatraw")) { }
                if (ctrlWordData.CtrlWord.Equals("clcfpat")) { }
                if (ctrlWordData.CtrlWord.Equals("clcfpatraw")) { }
                //table rows
                if (ctrlWordData.CtrlWord.Equals("trcfpat")) { }
                if (ctrlWordData.CtrlWord.Equals("trcbpat")) { }
                //paragraph border
                if (ctrlWordData.CtrlWord.Equals("brdrcf")) { }

                /* TABLES */
                if (ctrlWordData.CtrlWord.Equals("trowd")) /*Beginning of row*/ { _tableLevel++; }
                if (ctrlWordData.CtrlWord.Equals("cell")) /*End of Cell Denotes the end of a table cell*/
                {
                    //              String ctl = ctrlWordData.ctrlWord;
                    //              System.out.Print("cell found");
                }
                if (ctrlWordData.CtrlWord.Equals("row")) /*End of row*/ { _tableLevel++; }
                if (ctrlWordData.CtrlWord.Equals("lastrow")) /*Last row of the table*/ { }
                if (ctrlWordData.CtrlWord.Equals("row")) /*End of row*/ { _tableLevel++; }
                if (ctrlWordData.CtrlWord.Equals("irow")) /*param  is the row index of this row.*/ { }
                if (ctrlWordData.CtrlWord.Equals("irowband")) /*param is the row index of the row, adjusted to account for header rows. A header row has a value of -1.*/ { }
                if (ctrlWordData.CtrlWord.Equals("tcelld")) /*Sets table cell defaults*/ { }
                if (ctrlWordData.CtrlWord.Equals("nestcell")) /*Denotes the end of a nested cell.*/ { }
                if (ctrlWordData.CtrlWord.Equals("nestrow")) /*Denotes the end of a nested row*/ { }
                if (ctrlWordData.CtrlWord.Equals("nesttableprops")) /*Defines the properties of a nested table. This is a destination control word*/ { }
                if (ctrlWordData.CtrlWord.Equals("nonesttables")) /*Contains text for readers that do not understand nested tables. This destination should be ignored by readers that support nested tables.*/ { }
                if (ctrlWordData.CtrlWord.Equals("trgaph")) /*Half the space between the cells of a table row in twips.*/ { }
                if (ctrlWordData.CtrlWord.Equals("cellx")) /*param Defines the right boundary of a table cell, including its half of the space between cells.*/ { }
                if (ctrlWordData.CtrlWord.Equals("clmgf")) /*The first cell in a range of table cells to be merged.*/ { }
                if (ctrlWordData.CtrlWord.Equals("clmrg")) /*Contents of the table cell are merged with those of the preceding cell*/ { }
                if (ctrlWordData.CtrlWord.Equals("clvmgf")) /*The first cell in a range of table cells to be vertically merged.*/ { }
                if (ctrlWordData.CtrlWord.Equals("clvmrg")) /*Contents of the table cell are vertically merged with those of the preceding cell*/ { }
                /* TABLE: table row revision tracking */
                if (ctrlWordData.CtrlWord.Equals("trauth")) /*With revision tracking enabled, this control word identifies the author of changes to a table row's properties. N refers to a value in the revision table*/ { }
                if (ctrlWordData.CtrlWord.Equals("trdate")) /*With revision tracking enabled, this control word identifies the date of a revision*/ { }
                /* TABLE: Autoformatting flags */
                if (ctrlWordData.CtrlWord.Equals("tbllkborder")) /*Flag sets table autoformat to format borders*/ { }
                if (ctrlWordData.CtrlWord.Equals("tbllkshading")) /*Flag sets table autoformat to affect shading.*/ { }
                if (ctrlWordData.CtrlWord.Equals("tbllkfont")) /*Flag sets table autoformat to affect font*/ { }
                if (ctrlWordData.CtrlWord.Equals("tbllkcolor")) /*Flag sets table autoformat to affect color*/ { }
                if (ctrlWordData.CtrlWord.Equals("tbllkbestfit")) /*Flag sets table autoformat to apply best fit*/ { }
                if (ctrlWordData.CtrlWord.Equals("tbllkhdrrows")) /*Flag sets table autoformat to format the first (header) row*/ { }
                if (ctrlWordData.CtrlWord.Equals("tbllklastrow")) /*Flag sets table autoformat to format the last row.*/ { }
                if (ctrlWordData.CtrlWord.Equals("tbllkhdrcols")) /*Flag sets table autoformat to format the first (header) column*/ { }
                if (ctrlWordData.CtrlWord.Equals("tbllklastcol")) /*Flag sets table autoformat to format the last column*/ { }
                if (ctrlWordData.CtrlWord.Equals("tbllknorowband")) /*Specifies row banding conditional formatting shall not be applied*/ { }
                if (ctrlWordData.CtrlWord.Equals("tbllknocolband")) /*Specifies column banding conditional formatting shall not be applied.*/ { }
                /* TABLE: Row Formatting */
                if (ctrlWordData.CtrlWord.Equals("taprtl")) /*Table direction is right to left*/ { }
                if (ctrlWordData.CtrlWord.Equals("trautofit")) /*param = AutoFit:
    0   No AutoFit (default).
    1   AutoFit is on for the row. Overridden by \clwWidthN and \trwWidthN in any table row.
    */
                { }
                if (ctrlWordData.CtrlWord.Equals("trhdr")) /*Table row header. This row should appear at the top of every page on which the current table appears*/ { }
                if (ctrlWordData.CtrlWord.Equals("trkeep")) /*Keep table row together. This row cannot be split by a page break. This property is assumed to be off unless the control word is present*/ { }
                if (ctrlWordData.CtrlWord.Equals("trkeepfollow")) /*Keep row in the same page as the following row.*/ { }
                if (ctrlWordData.CtrlWord.Equals("trleft")) /*Position in twips of the leftmost edge of the table with respect to the left edge of its column.*/ { }
                if (ctrlWordData.CtrlWord.Equals("trqc")) /*Centers a table row with respect to its containing column.*/ { }
                if (ctrlWordData.CtrlWord.Equals("trql")) /*Left-justifies a table row with respect to its containing column.*/ { }
                if (ctrlWordData.CtrlWord.Equals("trqr")) /*Right-justifies a table row with respect to its containing column*/ { }
                if (ctrlWordData.CtrlWord.Equals("trrh")) /*Height of a table row in twips. When 0, the height is sufficient for all the text in the line; when positive, the height is guaranteed to be at least the specified height; when negative, the absolute value of the height is used, regardless of the height of the text in the line*/ { }
                if (ctrlWordData.CtrlWord.Equals("trpaddb")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trpaddl")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trpaddr")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trpaddt")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trpaddfb")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trpaddfl")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trpaddfr")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trpaddft")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trspdl")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trspdt")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trspdb")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trspdr")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trspdfl")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trspdft")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trspdfb")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trspdfr")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trwWidth")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trftsWidth")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trwWidthB")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trftsWidthB")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trftsWidthB")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trwWidthA")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trftsWidthA")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("tblind")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("tblindtype")) /* */ { }
                /*TABLE: Row shading and Background Colors*/
                if (ctrlWordData.CtrlWord.Equals("trcbpat")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trcfpat")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trpat")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trshdng")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trbgbdiag")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trbgcross")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trbgdcross")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trbgdkbdiag")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trbgdkcross")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trbgdkdcross")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trbgdkfdiag")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trbgdkhor")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trbgdkvert")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trbgfdiag")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trbghoriz")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trbgvert")) /* */ { }
                /* TABLE: Cell Formatting*/
                if (ctrlWordData.CtrlWord.Equals("clFitText")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("clNoWrap")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("clpadl")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("clpadt")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("clpadb")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("clpadr")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("clpadfl")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("clpadft")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("clpadfb")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("clpadfr")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("clwWidth")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("clftsWidth")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("clhidemark")) /* */ { }
                /* TABLE: Compared Table Cells */
                if (ctrlWordData.CtrlWord.Equals("clins")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("cldel")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("clmrgd")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("clmrgdr")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("clsplit")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("clsplitr")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("clinsauth")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("clinsdttm")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("cldelauth")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("cldeldttm")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("clmrgdauth")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("clmrgddttm")) /* */ { }
                /*TABLE: Position Wrapped Tables (The following properties must be the same for all rows in the table.)*/
                if (ctrlWordData.CtrlWord.Equals("tdfrmtxtLeft")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("tdfrmtxtRight")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("tdfrmtxtTop")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("tdfrmtxtBottom")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("tabsnoovrlp")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("tphcol")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("tphmrg")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("tphpg")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("tposnegx")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("tposnegy")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("tposx")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("tposxc")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("tposxi")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("tposxl")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("tposxo")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("tposxr")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("tposy")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("tposyb")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("tposyc")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("tposyil")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("tposyin")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("tposyout")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("tposyt")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("tpvmrg")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("tpvpara")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("tpvpg")) /* */ { }
                /* TABLE: Bidirectional Controls */
                if (ctrlWordData.CtrlWord.Equals("rtlrow")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("ltrrow")) /* */ { }
                /* TABLE: Row Borders */
                if (ctrlWordData.CtrlWord.Equals("trbrdrt")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trbrdrl")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trbrdrb")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trbrdrr")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trbrdrh")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("trbrdrv")) /* */ { }
                /* TABLE: Cell Borders */
                if (ctrlWordData.CtrlWord.Equals("brdrnil")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("clbrdrb")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("clbrdrt")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("clbrdrl")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("clbrdrr")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("cldglu")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("cldgll")) /* */ { }
                if (ctrlWordData.CtrlWord.Equals("")) /* */ { }
            }
            if (ctrlWordData.CtrlWordType == RtfCtrlWordType.TOGGLE)
            {
                RtfParser.GetState().Properties.ToggleProperty(ctrlWordData);//ctrlWordData.specialHandler);
            }

            if (ctrlWordData.CtrlWordType == RtfCtrlWordType.FLAG ||
                    ctrlWordData.CtrlWordType == RtfCtrlWordType.VALUE)
            {
                RtfParser.GetState().Properties.SetProperty(ctrlWordData);//ctrlWordData.specialHandler, ctrlWordData.param);
            }

            switch (_conversionType)
            {
                case RtfParser.TYPE_IMPORT_FULL:
                    if (!_importIgnoredCtrlwords.Contains(ctrlWordData.CtrlWord))
                    {
                        writeBuffer();
                        writeText(ctrlWordData.ToString());
                    }
                    result = true;
                    break;
                case RtfParser.TYPE_IMPORT_FRAGMENT:
                    if (!_importIgnoredCtrlwords.Contains(ctrlWordData.CtrlWord))
                    {
                        writeBuffer();
                        writeText(ctrlWordData.ToString());
                    }
                    result = true;
                    break;
                case RtfParser.TYPE_CONVERT:
                    if (_importIgnoredCtrlwords.Contains(ctrlWordData.CtrlWord) == false)
                    {
                    }
                    result = true;
                    break;
                default:    // error because is should be an import or convert
                    result = false;
                    break;
            }




            return result;
        }
Exemplo n.º 8
0
 /* (non-Javadoc)
  * @see com.lowagie.text.rtf.parser.destinations.RtfDestination#handleControlWord(com.lowagie.text.rtf.parser.ctrlwords.RtfCtrlWordData)
  */
 public override bool HandleControlWord(RtfCtrlWordData ctrlWordData)
 {
     return(true);
 }
        public override bool HandleControlWord(RtfCtrlWordData ctrlWordData)
        {
            bool result       = false;
            bool skipCtrlWord = false;

            if (this.rtfParser.IsImport())
            {
                skipCtrlWord = true;
                if (ctrlWordData.ctrlWord.Equals("shppict"))
                {
                    result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("nonshppict"))      // never gets here because this is a destination set to null
                {
                    skipCtrlWord = true; this.rtfParser.SetTokeniserStateSkipGroup(); result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("blipuid"))
                {
                    skipCtrlWord = true; this.rtfParser.SetTokeniserStateSkipGroup(); result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("picprop"))
                {
                    skipCtrlWord = true; this.rtfParser.SetTokeniserStateSkipGroup(); result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("pict"))
                {
                    result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("emfblip"))
                {
                    result = true; pictureType = Image.ORIGINAL_NONE;
                }
                if (ctrlWordData.ctrlWord.Equals("pngblip"))
                {
                    result = true; pictureType = Image.ORIGINAL_PNG;
                }
                if (ctrlWordData.ctrlWord.Equals("jepgblip"))
                {
                    result = true; pictureType = Image.ORIGINAL_JPEG;
                }
                if (ctrlWordData.ctrlWord.Equals("macpict"))
                {
                    result = true; pictureType = Image.ORIGINAL_NONE;
                }
                if (ctrlWordData.ctrlWord.Equals("pmmetafile"))
                {
                    result = true; pictureType = Image.ORIGINAL_NONE;
                }
                if (ctrlWordData.ctrlWord.Equals("wmetafile"))
                {
                    result = true; pictureType = Image.ORIGINAL_WMF;
                }
                if (ctrlWordData.ctrlWord.Equals("dibitmap"))
                {
                    result = true; pictureType = Image.ORIGINAL_NONE;
                }
                if (ctrlWordData.ctrlWord.Equals("wbitmap"))
                {
                    result = true; pictureType = Image.ORIGINAL_BMP;
                }
                /* bitmap information */
                if (ctrlWordData.ctrlWord.Equals("wbmbitspixel"))
                {
                    result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("wbmplanes"))
                {
                    result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("wbmwidthbytes"))
                {
                    result = true;
                }
                /* picture size, scaling and cropping */
                if (ctrlWordData.ctrlWord.Equals("picw"))
                {
                    this.width = ctrlWordData.LongValue(); result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("pich"))
                {
                    this.height = ctrlWordData.LongValue(); result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("picwgoal"))
                {
                    this.desiredWidth = ctrlWordData.LongValue(); result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("pichgoal"))
                {
                    this.desiredHeight = ctrlWordData.LongValue(); result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("picscalex"))
                {
                    this.scaleX = ctrlWordData.IntValue(); result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("picscaley"))
                {
                    this.scaleY = ctrlWordData.IntValue(); result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("picscaled"))
                {
                    result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("picprop"))
                {
                    skipCtrlWord = true; this.rtfParser.SetTokeniserStateSkipGroup(); result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("defshp"))
                {
                    result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("piccropt"))
                {
                    this.cropTop = ctrlWordData.IntValue(); result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("piccropb"))
                {
                    this.cropBottom = ctrlWordData.IntValue(); result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("piccropl"))
                {
                    this.cropLeft = ctrlWordData.IntValue(); result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("piccropr"))
                {
                    this.cropRight = ctrlWordData.IntValue(); result = true;
                }
                /* metafile information */
                if (ctrlWordData.ctrlWord.Equals("picbmp"))
                {
                    result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("picbpp"))
                {
                    result = true;
                }
                /* picture data */
                if (ctrlWordData.ctrlWord.Equals("bin"))
                {
                    this.dataFormat = FORMAT_BINARY;
                    // set length to param
                    this.binaryLength = ctrlWordData.LongValue();
                    this.rtfParser.SetTokeniserStateBinary(binaryLength);
                    result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("blipupi"))
                {
                    result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("blipuid"))
                {
                    skipCtrlWord = true; this.rtfParser.SetTokeniserStateSkipGroup(); result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("bliptag"))
                {
                    result = true;
                }
            }
            if (this.rtfParser.IsConvert())
            {
                if (ctrlWordData.ctrlWord.Equals("shppict"))
                {
                    result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("nonshppict"))
                {
                    skipCtrlWord = true; this.rtfParser.SetTokeniserStateSkipGroup(); result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("blipuid"))
                {
                    result = true; this.rtfParser.SetTokeniserStateSkipGroup(); result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("pict"))
                {
                    result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("emfblip"))
                {
                    result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("pngblip"))
                {
                    result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("jepgblip"))
                {
                    result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("macpict"))
                {
                    result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("pmmetafile"))
                {
                    result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("wmetafile"))
                {
                    skipCtrlWord = true; this.rtfParser.SetTokeniserStateSkipGroup(); result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("dibitmap"))
                {
                    result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("wbitmap"))
                {
                    result = true;
                }
                /* bitmap information */
                if (ctrlWordData.ctrlWord.Equals("wbmbitspixel"))
                {
                    result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("wbmplanes"))
                {
                    result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("wbmwidthbytes"))
                {
                    result = true;
                }
                /* picture size, scaling and cropping */
                if (ctrlWordData.ctrlWord.Equals("picw"))
                {
                    this.width = ctrlWordData.LongValue(); result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("pich"))
                {
                    this.height = ctrlWordData.LongValue(); result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("picwgoal"))
                {
                    this.desiredWidth = ctrlWordData.LongValue(); result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("pichgoal"))
                {
                    this.desiredHeight = ctrlWordData.LongValue(); result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("picscalex"))
                {
                    this.scaleX = ctrlWordData.IntValue(); result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("picscaley"))
                {
                    this.scaleY = ctrlWordData.IntValue(); result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("picscaled"))
                {
                    result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("picprop"))
                {
                    skipCtrlWord = true; this.rtfParser.SetTokeniserStateSkipGroup(); result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("defshp"))
                {
                    result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("piccropt"))
                {
                    this.cropTop = ctrlWordData.IntValue(); result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("piccropb"))
                {
                    this.cropBottom = ctrlWordData.IntValue(); result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("piccropl"))
                {
                    this.cropLeft = ctrlWordData.IntValue(); result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("piccropr"))
                {
                    this.cropRight = ctrlWordData.IntValue(); result = true;
                }
                /* metafile information */
                if (ctrlWordData.ctrlWord.Equals("picbmp"))
                {
                    result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("picbpp"))
                {
                    result = true;
                }
                /* picture data */
                if (ctrlWordData.ctrlWord.Equals("bin"))
                {
                    dataFormat = FORMAT_BINARY; result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("blipupi"))
                {
                    result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("blipuid"))
                {
                    skipCtrlWord = true; this.rtfParser.SetTokeniserStateSkipGroup(); result = true;
                }
                if (ctrlWordData.ctrlWord.Equals("bliptag"))
                {
                    result = true;
                }
            }
            if (!skipCtrlWord)
            {
                switch (this.rtfParser.GetConversionType())
                {
                case RtfParser.TYPE_IMPORT_FULL:
                    WriteBuffer();
                    WriteText(ctrlWordData.ToString());
                    result = true;
                    break;

                case RtfParser.TYPE_IMPORT_FRAGMENT:
                    WriteBuffer();
                    WriteText(ctrlWordData.ToString());
                    result = true;
                    break;

                case RtfParser.TYPE_CONVERT:
                    result = true;
                    break;

                default: // error because is should be an import or convert
                    result = false;
                    break;
                }
            }
            return(result);
        }
        public override bool HandleControlWord(RtfCtrlWordData ctrlWordData)
        {
            bool result = true;

            this.OnCtrlWord(ctrlWordData);  // event handler

            if (this.rtfParser.IsImport())
            {
                // information
                if (ctrlWordData.ctrlWord.Equals("s"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("cs"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("ds"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("ts"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tsrowd"))
                {
                }

                if (ctrlWordData.ctrlWord.Equals("keycode"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("shift"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("ctrl"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("alt"))
                {
                }
                //cells
                if (ctrlWordData.ctrlWord.Equals("fn"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("additive"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("sbasedon"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("snext"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("sautoupd"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("shidden"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("slink"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("slocked"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("spersonal"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("scompose"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("sreply"))
                {
                }
                /* FORMATTING */
                // brdrdef/parfmt/apoctl/tabdef/shading/chrfmt



                if (ctrlWordData.ctrlWord.Equals("styrsid"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("ssemihidden"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("sqformat"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("spriority"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("sunhideused"))
                {
                }

                /* TABLE STYLES */
                if (ctrlWordData.ctrlWord.Equals("tscellwidth"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tscellwidthfts"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tscellpaddt"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tscellpaddl"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tscellpaddr"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tscellpaddb"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tscellpaddft"))/*0-auto, 3-twips*/
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tscellpaddfl"))/*0-auto, 3-twips*/
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tscellpaddfr"))/*0-auto, 3-twips*/
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tscellpaddfb"))/*0-auto, 3-twips*/
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tsvertalt"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tsvertalc"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tsvertalb"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tsnowrap"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tscellcfpat"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tscellcbpat"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tsbgbdiag"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tsbgfdiag"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tsbgcross"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tsbgdcross"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tsbgdkcross "))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tsbgdkdcross"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tsbghoriz"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tsbgvert"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tsbgdkhor"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tsbgdkvert"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tsbrdrt"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tsbrdrb"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tsbrdrl"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tsbrdrr"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tsbrdrh"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tsbrdrv"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tsbrdrdgl"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tsbrdrdgr"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tscbandsh"))
                {
                }
                if (ctrlWordData.ctrlWord.Equals("tscbandsv"))
                {
                }
            }
            if (ctrlWordData.ctrlWordType == RtfCtrlWordType.FLAG ||
                ctrlWordData.ctrlWordType == RtfCtrlWordType.TOGGLE ||
                ctrlWordData.ctrlWordType == RtfCtrlWordType.VALUE)
            {
                this.rtfParser.GetState().properties.SetProperty(ctrlWordData);
            }

            switch (this.rtfParser.GetConversionType())
            {
            case RtfParser.TYPE_IMPORT_FULL:
                result = true;
                break;

            case RtfParser.TYPE_IMPORT_FRAGMENT:
                result = true;
                break;

            case RtfParser.TYPE_CONVERT:
                result = true;
                break;

            default:    // error because is should be an import or convert
                result = false;
                break;
            }
            return(result);
        }
Exemplo n.º 11
0
 /// <summary>
 /// (non-Javadoc)
 /// @see com.lowagie.text.rtf.parser.destinations.RtfDestination#handleControlWord(com.lowagie.text.rtf.parser.ctrlwords.RtfCtrlWordData)
 /// </summary>
 public override bool HandleControlWord(RtfCtrlWordData ctrlWordData)
 {
     _elementName = ctrlWordData.CtrlWord;
     return(true);
 }
Exemplo n.º 12
0
 /**
  * Handle control word for this destination
  * @param ctrlWordData The control word and parameter information object
  * @return true if handled, false if not handled
  */
 public abstract bool HandleControlWord(RtfCtrlWordData ctrlWordData);
Exemplo n.º 13
0
        /// <summary>
        /// (non-Javadoc)
        /// @see com.lowagie.text.rtf.parser.destinations.RtfDestination#handleControlWord(com.lowagie.text.rtf.parser.ctrlwords.RtfCtrlWordData)
        /// @since 2.0.8
        /// </summary>
        public override bool HandleControlWord(RtfCtrlWordData ctrlWordData)
        {
            bool result = true;

            // just let fonttbl fall through and set last ctrl word object.

            if (ctrlWordData.CtrlWord.Equals("f"))
            {
                SetFontNumber(ctrlWordData.Param); result = true;
            }
            if (ctrlWordData.CtrlWord.Equals("fcharset"))
            {
                SetCharset(ctrlWordData.Param); result = true;
            }

            // font families
            if (ctrlWordData.CtrlWord.Equals("fnil"))
            {
                SetFontFamily("roman"); result = true;
            }
            if (ctrlWordData.CtrlWord.Equals("froman"))
            {
                SetFontFamily("roman"); result = true;
            }
            if (ctrlWordData.CtrlWord.Equals("fswiss"))
            {
                SetFontFamily("swiss"); result = true;
            }
            if (ctrlWordData.CtrlWord.Equals("fmodern"))
            {
                SetFontFamily("modern"); result = true;
            }
            if (ctrlWordData.CtrlWord.Equals("fscript"))
            {
                SetFontFamily("script"); result = true;
            }
            if (ctrlWordData.CtrlWord.Equals("fdecor"))
            {
                SetFontFamily("decor"); result = true;
            }
            if (ctrlWordData.CtrlWord.Equals("ftech"))
            {
                SetFontFamily("tech"); result = true;
            }
            if (ctrlWordData.CtrlWord.Equals("fbidi"))
            {
                SetFontFamily("bidi"); result = true;
            }
            // pitch
            if (ctrlWordData.CtrlWord.Equals("fprq"))
            {
                SetPitch(ctrlWordData.Param); result = true;
            }
            // bias
            if (ctrlWordData.CtrlWord.Equals("fbias"))
            {
                SetBias(ctrlWordData.Param); result = true;
            }
            // theme font information
            if (ctrlWordData.CtrlWord.Equals("flomajor"))
            {
                SetThemeFont("flomajor"); result = true;
            }
            if (ctrlWordData.CtrlWord.Equals("fhimajor"))
            {
                SetThemeFont("fhimajor"); result = true;
            }
            if (ctrlWordData.CtrlWord.Equals("fdbmajor"))
            {
                SetThemeFont("fdbmajor"); result = true;
            }
            if (ctrlWordData.CtrlWord.Equals("fbimajor"))
            {
                SetThemeFont("fbimajor"); result = true;
            }
            if (ctrlWordData.CtrlWord.Equals("flominor"))
            {
                SetThemeFont("flominor"); result = true;
            }
            if (ctrlWordData.CtrlWord.Equals("fhiminor"))
            {
                SetThemeFont("fhiminor"); result = true;
            }
            if (ctrlWordData.CtrlWord.Equals("fdbminor"))
            {
                SetThemeFont("fdbminor"); result = true;
            }
            if (ctrlWordData.CtrlWord.Equals("fbiminor"))
            {
                SetThemeFont("fbiminor"); result = true;
            }

            // panose
            if (ctrlWordData.CtrlWord.Equals("panose"))
            {
                _state = SettingPanose; result = true;
            }

            // \*\fname
            // <font name> #PCDATA
            if (ctrlWordData.CtrlWord.Equals("fname"))
            {
                _state = SettingFontname; result = true;
            }

            // \*\falt
            if (ctrlWordData.CtrlWord.Equals("falt"))
            {
                _state = SettingAlternate; result = true;
            }

            // \*\fontemb
            if (ctrlWordData.CtrlWord.Equals("fontemb"))
            {
                _state = SettingFontEmbed; result = true;
            }

            // font type
            if (ctrlWordData.CtrlWord.Equals("ftnil"))
            {
                SetTrueType("ftnil"); result = true;
            }
            if (ctrlWordData.CtrlWord.Equals("fttruetype"))
            {
                SetTrueType("fttruetype"); result = true;
            }

            // \*\fontfile
            if (ctrlWordData.CtrlWord.Equals("fontemb"))
            {
                _state = SettingFontFile; result = true;
            }

            // codepage
            if (ctrlWordData.CtrlWord.Equals("cpg"))
            {
                SetCodePage(ctrlWordData.Param); result = true;
            }

            LastCtrlWord = ctrlWordData;
            return(result);
        }