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")); Assert.AreEqual(false, ls.IsLatentStyle("notex1")); }
/** * Read document */ internal override void OnDocumentRead() { StylesDocument stylesDoc; try { XDocument 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); } }