示例#1
0
 /**
 * Register a RtfParagraphStyle with this RtfStylesheetList.
 *
 * @param rtfParagraphStyle The RtfParagraphStyle to add.
 */
 public void RegisterParagraphStyle(RtfParagraphStyle rtfParagraphStyle)
 {
     RtfParagraphStyle tempStyle = new RtfParagraphStyle(this.document, rtfParagraphStyle);
     tempStyle.HandleInheritance();
     tempStyle.SetStyleNumber(this.styleMap.Count);
     this.styleMap[tempStyle.GetStyleName()] = tempStyle;
 }
示例#2
0
        /**
         * Register a RtfParagraphStyle with this RtfStylesheetList.
         *
         * @param rtfParagraphStyle The RtfParagraphStyle to add.
         */
        public void RegisterParagraphStyle(RtfParagraphStyle rtfParagraphStyle)
        {
            RtfParagraphStyle tempStyle = new RtfParagraphStyle(this.document, rtfParagraphStyle);

            tempStyle.HandleInheritance();
            tempStyle.SetStyleNumber(this.styleMap.Count);
            this.styleMap[tempStyle.GetStyleName()] = tempStyle;
        }
示例#3
0
        /**
         * Tests whether two RtfParagraphStyles are equal. Equality
         * is determined via the name.
         */
        public override bool Equals(Object o)
        {
            if (!(o is RtfParagraphStyle))
            {
                return(false);
            }
            RtfParagraphStyle paragraphStyle = (RtfParagraphStyle)o;
            bool result = this.GetStyleName().Equals(paragraphStyle.GetStyleName());

            return(result);
        }
示例#4
0
        /**
         * Constructs a RtfParagraphStyle from another RtfParagraphStyle.
         *
         * INTERNAL USE ONLY
         *
         * @param doc The RtfDocument this RtfParagraphStyle belongs to.
         * @param style The RtfParagraphStyle to copy settings from.
         */
        public RtfParagraphStyle(RtfDocument doc, RtfParagraphStyle style) : base(doc, style)
        {
            this.document             = doc;
            this.styleName            = style.GetStyleName();
            this.alignment            = style.GetAlignment();
            this.firstLineIndent      = (int)(style.GetFirstLineIndent() * RtfElement.TWIPS_FACTOR);
            this.indentLeft           = (int)(style.GetIndentLeft() * RtfElement.TWIPS_FACTOR);
            this.indentRight          = (int)(style.GetIndentRight() * RtfElement.TWIPS_FACTOR);
            this.spacingBefore        = (int)(style.GetSpacingBefore() * RtfElement.TWIPS_FACTOR);
            this.spacingAfter         = (int)(style.GetSpacingAfter() * RtfElement.TWIPS_FACTOR);
            this.lineLeading          = (int)(style.GetLineLeading() * RtfElement.TWIPS_FACTOR);
            this.keepTogether         = style.GetKeepTogether();
            this.keepTogetherWithNext = style.GetKeepTogetherWithNext();
            this.basedOnName          = style.basedOnName;
            this.modified             = style.modified;
            this.styleNumber          = style.GetStyleNumber();

            if (this.document != null)
            {
                SetRtfDocument(this.document);
            }
        }
示例#5
0
        /**
        * Constructs a RtfParagraphStyle from another RtfParagraphStyle.
        *
        * INTERNAL USE ONLY
        *
        * @param doc The RtfDocument this RtfParagraphStyle belongs to.
        * @param style The RtfParagraphStyle to copy settings from.
        */
        public RtfParagraphStyle(RtfDocument doc, RtfParagraphStyle style)
            : base(doc, style)
        {
            this.document = doc;
            this.styleName = style.GetStyleName();
            this.alignment = style.GetAlignment();
            this.firstLineIndent = (int)(style.GetFirstLineIndent() * RtfElement.TWIPS_FACTOR);
            this.indentLeft = (int) (style.GetIndentLeft() * RtfElement.TWIPS_FACTOR);
            this.indentRight = (int) (style.GetIndentRight() * RtfElement.TWIPS_FACTOR);
            this.spacingBefore = (int) (style.GetSpacingBefore() * RtfElement.TWIPS_FACTOR);
            this.spacingAfter = (int) (style.GetSpacingAfter() * RtfElement.TWIPS_FACTOR);
            this.lineLeading = (int) (style.GetLineLeading() * RtfElement.TWIPS_FACTOR);
            this.keepTogether = style.GetKeepTogether();
            this.keepTogetherWithNext = style.GetKeepTogetherWithNext();
            this.basedOnName = style.basedOnName;
            this.modified = style.modified;
            this.styleNumber = style.GetStyleNumber();

            if (this.document != null) {
                SetRtfDocument(this.document);
            }
        }