Esempio n. 1
0
        public void TestSetStyles_Bug57254()
        {
            XWPFDocument docOut = new XWPFDocument();
            XWPFStyles   styles = docOut.CreateStyles();

            CT_Styles ctStyles   = new CT_Styles();
            String    strStyleId = "headline1";
            CT_Style  ctStyle    = ctStyles.AddNewStyle();

            ctStyle.styleId = (/*setter*/ strStyleId);
            styles.SetStyles(ctStyles);

            Assert.IsTrue(styles.StyleExist(strStyleId));

            XWPFDocument docIn = XWPFTestDataSamples.WriteOutAndReadBack(docOut);

            styles = docIn.GetStyles();
            Assert.IsTrue(styles.StyleExist(strStyleId));
        }
Esempio n. 2
0
        public void TestAddStylesToDocument()
        {
            XWPFDocument docOut = new XWPFDocument();
            XWPFStyles   styles = docOut.CreateStyles();

            String   strStyleId = "headline1";
            CT_Style ctStyle    = new CT_Style();

            ctStyle.styleId = (strStyleId);
            XWPFStyle s = new XWPFStyle(ctStyle);

            styles.AddStyle(s);

            Assert.IsTrue(styles.StyleExist(strStyleId));

            XWPFDocument docIn = XWPFTestDataSamples.WriteOutAndReadBack(docOut);

            styles = docIn.GetStyles();
            Assert.IsTrue(styles.StyleExist(strStyleId));
        }