Example #1
0
        /**
         * Whether the bold property shall be applied to all non-complex script
         * characters in the contents of this run.when displayed in a document
         * <p/>
         * <p/>
         * This formatting property is a toggle property, which specifies that its
         * behavior differs between its use within a style defInition and its use as
         * direct formatting. When used as part of a style defInition, Setting this
         * property shall toggle the current state of that property as specified up
         * to this point in the hierarchy (i.e. applied to not applied, and vice
         * versa). Setting it to <code>false</code> (or an equivalent) shall
         * result in the current Setting remaining unChanged. However, when used as
         * direct formatting, Setting this property to true or false shall Set the
         * absolute state of the resulting property.
         * </p>
         * <p/>
         * 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 bold shall not be
         * applied to non-complex script characters.
         * </p>
         *
         * @param value <code>true</code> if the italic property is applied to
         *              this run
         */
        public void SetItalic(bool value)
        {
            CT_RPr   pr     = run.IsSetRPr() ? run.rPr : run.AddNewRPr();
            CT_OnOff italic = pr.IsSetI() ? pr.i : pr.AddNewI();

            italic.val = (value ? ST_OnOff.True : ST_OnOff.False);
        }
Example #2
0
        public void TestSetGetItalic()
        {
            CT_RPr rpr = ctRun.AddNewRPr();

            rpr.AddNewI().val = (ST_OnOff.True);

            XWPFRun run = new XWPFRun(ctRun, p);

            Assert.AreEqual(true, run.IsItalic());

            run.SetItalic(false);
            Assert.AreEqual(ST_OnOff.False, rpr.i.val);
        }
Example #3
0
        public void TestSetGetItalic()
        {
            CT_RPr rpr = ctRun.AddNewRPr();

            rpr.AddNewI().val = true;

            XWPFRun run = new XWPFRun(ctRun, p);

            Assert.AreEqual(true, run.IsItalic);

            run.IsItalic = false;
            Assert.AreEqual(false, rpr.i.val);
        }
Example #4
0
        public void SetItalic(bool value)
        {
            CT_RPr ctRpr = this.run.IsSetRPr() ? this.run.rPr : this.run.AddNewRPr();

            (ctRpr.IsSetI() ? ctRpr.i : ctRpr.AddNewI()).val = value ? ST_OnOff.True : ST_OnOff.False;
        }