Exemplo n.º 1
0
        public void TestLatentStyles()
        {
            CT_LatentStyles latentStyles = new CT_LatentStyles();
            CT_LsdException ex           = latentStyles.AddNewLsdException();

            ex.name = ("ex1");
            XWPFLatentStyles ls = new XWPFLatentStyles(latentStyles);

            Assert.AreEqual(true, ls.IsLatentStyle("ex1"));
        }
Exemplo n.º 2
0
 internal override void OnDocumentRead()
 {
   try
   {
     this.ctStyles = StylesDocument.Parse(this.GetPackagePart().GetInputStream()).Styles;
     this.latentStyles = new XWPFLatentStyles(this.ctStyles.latentStyles, this);
   }
   catch (XmlException ex)
   {
     throw new POIXMLException("Unable to read styles", (Exception) ex);
   }
   foreach (CT_Style style in (IEnumerable<CT_Style>) this.ctStyles.GetStyleList())
     this.listStyle.Add(new XWPFStyle(style, this));
 }
Exemplo n.º 3
0
        /**
         * Read document
         */

        internal override void OnDocumentRead()
        {
            StylesDocument stylesDoc;

            try
            {
                XmlDocument doc = ConvertStreamToXml(GetPackagePart().GetInputStream());
                stylesDoc = StylesDocument.Parse(doc, NamespaceManager);
                SetStyles(stylesDoc.Styles);
                latentStyles = new XWPFLatentStyles(ctStyles.latentStyles, this);
            }
            catch (XmlException e)
            {
                throw new POIXMLException("Unable to read styles", e);
            }
        }
Exemplo n.º 4
0
        /**
         * Read document
         */

        internal override void OnDocumentRead()
        {
            StylesDocument stylesDoc;
            try
            {
                XmlDocument doc = ConvertStreamToXml(GetPackagePart().GetInputStream());
                stylesDoc = StylesDocument.Parse(doc,NamespaceManager);
                SetStyles(stylesDoc.Styles);
                latentStyles = new XWPFLatentStyles(ctStyles.latentStyles, this);

            }
            catch (XmlException e)
            {
                throw new POIXMLException("Unable to read styles", e);
            }
        }
Exemplo n.º 5
0
        /**
         * Read document
         */

        internal override void OnDocumentRead()
        {
            StylesDocument stylesDoc;

            try
            {
                Stream is1 = GetPackagePart().GetInputStream();
                stylesDoc    = StylesDocument.Parse(is1);
                ctStyles     = stylesDoc.Styles;
                latentStyles = new XWPFLatentStyles(ctStyles.latentStyles, this);
            }
            catch (XmlException e)
            {
                throw new POIXMLException("Unable to read styles", e);
            }
            // Build up all the style objects
            foreach (CT_Style style in ctStyles.GetStyleList())
            {
                listStyle.Add(new XWPFStyle(style, this));
            }
        }
Exemplo n.º 6
0
        /**
         * Read document
         */

        internal override void OnDocumentRead()
        {
            StylesDocument stylesDoc;
            try
            {
                Stream is1 = GetPackagePart().GetInputStream();
                stylesDoc = StylesDocument.Parse(is1);
                ctStyles = stylesDoc.Styles;
                latentStyles = new XWPFLatentStyles(ctStyles.latentStyles, this);

            }
            catch (XmlException e)
            {
                throw new POIXMLException("Unable to read styles", e);
            }
            // Build up all the style objects
            foreach (CT_Style style in ctStyles.GetStyleList())
            {
                listStyle.Add(new XWPFStyle(style, this));
            }
        }
Exemplo n.º 7
0
        public void TestLatentStyles()
        {
            CT_LatentStyles latentStyles = new CT_LatentStyles();
            CT_LsdException ex = latentStyles.AddNewLsdException();
            ex.name=("ex1");
            XWPFLatentStyles ls = new XWPFLatentStyles(latentStyles);
            Assert.AreEqual(true, ls.IsLatentStyle("ex1"));

        }