コード例 #1
0
ファイル: XWPFStyles.cs プロジェクト: jdineshk/npoi
        /**
         * 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));
            }
        }
コード例 #2
0
ファイル: XWPFStyles.cs プロジェクト: Reinakumiko/npoi
        /**
         * Sets the ctStyles
         * @param styles
         */
        public void SetStyles(CT_Styles styles)
        {
            ctStyles = styles;
            // Build up all the style objects
            foreach (CT_Style style in ctStyles.GetStyleList())
            {
                listStyle.Add(new XWPFStyle(style, this));
            }

            if (ctStyles.IsSetDocDefaults())
            {
                CT_DocDefaults docDefaults = ctStyles.docDefaults;
                if (docDefaults.IsSetRPrDefault() && docDefaults.rPrDefault.IsSetRPr())
                {
                    defaultRunStyle = new XWPFDefaultRunStyle(
                            docDefaults.rPrDefault.rPr);
                }
                if (docDefaults.IsSetPPrDefault() && docDefaults.pPrDefault.IsSetPPr())
                {
                    defaultParaStyle = new XWPFDefaultParagraphStyle(
                            docDefaults.pPrDefault.pPr);
                }
            }

        }
コード例 #3
0
ファイル: XWPFStyles.cs プロジェクト: age-soft/npoi
 /**
  * Sets the ctStyles
  * @param styles
  */
 public void SetStyles(CT_Styles styles)
 {
     ctStyles = styles;
     // Build up all the style objects
     foreach (CT_Style style in ctStyles.GetStyleList())
     {
         listStyle.Add(new XWPFStyle(style, this));
     }
 }