Пример #1
0
        /**
         * This element specifies the amount by which text shall be raised or
         * lowered for this run.in relation to the default baseline of the
         * surrounding non-positioned text. This allows the text to be repositioned
         * without altering the font size of the contents.
         *
         * @return a big integer representing the amount of text shall be "moved"
         */
        public int GetTextPosition()
        {
            CT_RPr pr = run.rPr;

            return((pr != null && pr.IsSetPosition()) ? int.Parse(pr.position.val)
                    : -1);
        }
Пример #2
0
        /**
         * This element specifies the amount by which text shall be raised or
         * lowered for this run.in relation to the default baseline of the
         * surrounding non-positioned text. This allows the text to be repositioned
         * without altering the font size of the contents.
         *
         * If the val attribute is positive, then the parent run.shall be raised
         * above the baseline of the surrounding text by the specified number of
         * half-points. If the val attribute is negative, then the parent run.shall
         * be lowered below the baseline of the surrounding text by the specified
         * number of half-points.
         *         *
         * If this element is not present, the default value is to leave the
         * formatting applied at previous level in the style hierarchy. If this
         * element is never applied in the style hierarchy, then the text shall not
         * be raised or lowered relative to the default baseline location for the
         * contents of this run.
         */
        public void SetTextPosition(int val)
        {
            CT_RPr pr = run.IsSetRPr() ? run.rPr : run.AddNewRPr();
            CT_SignedHpsMeasure position = pr.IsSetPosition() ? pr.position : pr.AddNewPosition();

            position.val = (val.ToString());
        }
Пример #3
0
        public int GetTextPosition()
        {
            CT_RPr rPr = this.run.rPr;

            if (rPr == null || !rPr.IsSetPosition())
            {
                return(-1);
            }
            return(int.Parse(rPr.position.val));
        }
Пример #4
0
        public void SetTextPosition(int val)
        {
            CT_RPr ctRpr = this.run.IsSetRPr() ? this.run.rPr : this.run.AddNewRPr();

            (ctRpr.IsSetPosition() ? ctRpr.position : ctRpr.AddNewPosition()).val = val.ToString();
        }