示例#1
0
        public static CT_FlatText Parse(XElement node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_FlatText ctObj = new CT_FlatText();

            ctObj.z = XmlHelper.ReadLong(node.Attribute("z"));
            return(ctObj);
        }
示例#2
0
文件: Text.cs 项目: xewn/Npoi.Core
        public static CT_TextBodyProperties Parse(XElement node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_TextBodyProperties ctObj = new CT_TextBodyProperties();

            ctObj.rot = XmlHelper.ReadInt(node.Attribute("rot"));
            ctObj.spcFirstLastPara = XmlHelper.ReadBool(node.Attribute("spcFirstLastPara"));
            if (node.Attribute("vertOverflow") != null)
            {
                ctObj.vertOverflow = (ST_TextVertOverflowType)Enum.Parse(typeof(ST_TextVertOverflowType), node.Attribute("vertOverflow").Value);
            }
            if (node.Attribute("horzOverflow") != null)
            {
                ctObj.horzOverflow = (ST_TextHorzOverflowType)Enum.Parse(typeof(ST_TextHorzOverflowType), node.Attribute("horzOverflow").Value);
            }
            if (node.Attribute("vert") != null)
            {
                ctObj.vert = (ST_TextVerticalType)Enum.Parse(typeof(ST_TextVerticalType), node.Attribute("vert").Value);
            }
            if (node.Attribute("wrap") != null)
            {
                ctObj.wrap = (ST_TextWrappingType)Enum.Parse(typeof(ST_TextWrappingType), node.Attribute("wrap").Value);
            }
            ctObj.lIns        = XmlHelper.ReadInt(node.Attribute("lIns"));
            ctObj.tIns        = XmlHelper.ReadInt(node.Attribute("tIns"));
            ctObj.rIns        = XmlHelper.ReadInt(node.Attribute("rIns"));
            ctObj.bIns        = XmlHelper.ReadInt(node.Attribute("bIns"));
            ctObj.numCol      = XmlHelper.ReadInt(node.Attribute("numCol"));
            ctObj.spcCol      = XmlHelper.ReadInt(node.Attribute("spcCol"));
            ctObj.rtlCol      = XmlHelper.ReadBool(node.Attribute("rtlCol"));
            ctObj.fromWordArt = XmlHelper.ReadBool(node.Attribute("fromWordArt"));
            if (node.Attribute("anchor") != null)
            {
                ctObj.anchor = (ST_TextAnchoringType)Enum.Parse(typeof(ST_TextAnchoringType), node.Attribute("anchor").Value);
            }
            ctObj.anchorCtr   = XmlHelper.ReadBool(node.Attribute("anchorCtr"));
            ctObj.forceAA     = XmlHelper.ReadBool(node.Attribute("forceAA"));
            ctObj.upright     = XmlHelper.ReadBool(node.Attribute("upright"));
            ctObj.compatLnSpc = XmlHelper.ReadBool(node.Attribute("compatLnSpc"));
            foreach (XElement childNode in node.ChildElements())
            {
                if (childNode.Name.LocalName == "prstTxWarp")
                {
                    ctObj.prstTxWarp = CT_PresetTextShape.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "noAutofit")
                {
                    ctObj.noAutofit = new CT_TextNoAutofit();
                }
                else if (childNode.Name.LocalName == "normAutofit")
                {
                    ctObj.normAutofit = CT_TextNormalAutofit.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "spAutoFit")
                {
                    ctObj.spAutoFit = new CT_TextShapeAutofit();
                }
                else if (childNode.Name.LocalName == "scene3d")
                {
                    ctObj.scene3d = CT_Scene3D.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "sp3d")
                {
                    ctObj.sp3d = CT_Shape3D.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "flatTx")
                {
                    ctObj.flatTx = CT_FlatText.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "extLst")
                {
                    ctObj.extLst = CT_OfficeArtExtensionList.Parse(childNode, namespaceManager);
                }
            }
            return(ctObj);
        }