예제 #1
0
        internal void ReadXml(XElement node, MemoryFolder mFolder, XFile xFile)
        {
            foreach (XElement element in node.Elements())
            {
                string str8;
                if (element.Name.LocalName != "bodyPr")
                {
                    goto Label_039A;
                }
                string str6 = element.GetAttributeValueOrDefaultOfStringType("anchor", "t");
                if (str6 != null)
                {
                    if (str6 != "b")
                    {
                        if (str6 == "ctr")
                        {
                            goto Label_009C;
                        }
                        if (str6 == "dist")
                        {
                            goto Label_00A5;
                        }
                        if (str6 == "just")
                        {
                            goto Label_00AE;
                        }
                        if (str6 == "t")
                        {
                            goto Label_00B7;
                        }
                    }
                    else
                    {
                        this.TextAnchoringType = TextAnchoringTypes.Bottom;
                    }
                }
                goto Label_00BE;
Label_009C:
                this.TextAnchoringType = TextAnchoringTypes.Center;
                goto Label_00BE;
Label_00A5:
                this.TextAnchoringType = TextAnchoringTypes.Distributed;
                goto Label_00BE;
Label_00AE:
                this.TextAnchoringType = TextAnchoringTypes.Justified;
                goto Label_00BE;
Label_00B7:
                this.TextAnchoringType = TextAnchoringTypes.Top;
Label_00BE:
                this.IsTextBoxAnchorCenter = element.GetAttributeValueOrDefaultOfBooleanType("anchorCtr", false);
                string str7 = element.GetAttributeValueOrDefaultOfStringType("horzOverflow", "overflow");
                if (str7 != null)
                {
                    if (str7 == "overflow")
                    {
                        this.TextHorizontalOverflow = TextOverflowTypes.Overflow;
                    }
                    else if (str7 == "clip")
                    {
                        goto Label_010E;
                    }
                }
                goto Label_0115;
Label_010E:
                this.TextHorizontalOverflow = TextOverflowTypes.Clip;
Label_0115:
                if ((str8 = element.GetAttributeValueOrDefaultOfStringType("vertOverflow", "overflow")) != null)
                {
                    if (str8 != "overflow")
                    {
                        if (str8 == "clip")
                        {
                            goto Label_0161;
                        }
                        if (str8 == "ellipsis")
                        {
                            goto Label_016A;
                        }
                    }
                    else
                    {
                        this.TextVerticalOverflow = TextOverflowTypes.Overflow;
                    }
                }
                goto Label_0171;
Label_0161:
                this.TextVerticalOverflow = TextOverflowTypes.Clip;
                goto Label_0171;
Label_016A:
                this.TextVerticalOverflow = TextOverflowTypes.Ellipsis;
Label_0171:
                switch (element.GetAttributeValueOrDefaultOfStringType("vert", "horz"))
                {
                case "horz":
                    this.VerticalText = TextVerticalTypes.Horizontal;
                    break;

                case "vert":
                    this.VerticalText = TextVerticalTypes.Vertical;
                    break;

                case "vert270":
                    this.VerticalText = TextVerticalTypes.Vertical270;
                    break;

                case "wordArtVert":
                    this.VerticalText = TextVerticalTypes.WordArtVertical;
                    break;

                case "wordArtVertRtl":
                    this.VerticalText = TextVerticalTypes.VerticalWordArtRightToLeft;
                    break;

                case "eaVert":
                    this.VerticalText = TextVerticalTypes.EastAsianVertical;
                    break;

                case "mongolianVert":
                    this.VerticalText = TextVerticalTypes.MongolianVertical;
                    break;
                }
                int num  = element.GetAttributeValueOrDefaultOfInt32Type("tIns", 0xb298);
                int num2 = element.GetAttributeValueOrDefaultOfInt32Type("bIns", 0xb298);
                int num3 = element.GetAttributeValueOrDefaultOfInt32Type("lIns", 0x16530);
                int num4 = element.GetAttributeValueOrDefaultOfInt32Type("rIns", 0x16530);
                this.TopInset    = (((double)num) / 914400.0) * 72.0;
                this.BottomInset = (((double)num2) / 914400.0) * 72.0;
                this.LeftInset   = (((double)num3) / 914400.0) * 72.0;
                this.RightInset  = (((double)num4) / 914400.0) * 72.0;
                int num5 = element.GetAttributeValueOrDefaultOfInt32Type("rot", 0);
                this.Rotation = ((double)num5) / 60000.0;
                this.UpRight  = element.GetAttributeValueOrDefaultOfBooleanType("upRight", false);
                switch (element.GetAttributeValueOrDefaultOfStringType("wrap", "square"))
                {
                case "square":
                    this.TextWrappingType = TextWrappingTypes.Square;
                    break;

                case "none":
                    this.TextWrappingType = TextWrappingTypes.None;
                    break;
                }
                continue;
Label_039A:
                if ((element.Name.LocalName != "lstStyle") && (element.Name.LocalName == "p"))
                {
                    TextParagraph paragraph = new TextParagraph();
                    paragraph.ReadXml(element, mFolder, xFile);
                    this.TextParagraphs.Add(paragraph);
                }
            }
        }
예제 #2
0
        internal void ReadXml(XElement node, MemoryFolder mFolder, XFile xFile)
        {
            foreach (XElement element in node.Elements())
            {
                if (element.Name.LocalName == "bodyPr")
                {
                    string str = element.GetAttributeValueOrDefaultOfStringType("anchor", "t");
                    if (str == "b")
                    {
                        this.TextAnchoringType = TextAnchoringTypes.Bottom;
                    }
                    else if (str == "ctr")
                    {
                        this.TextAnchoringType = TextAnchoringTypes.Center;
                    }
                    else if (str == "dist")
                    {
                        this.TextAnchoringType = TextAnchoringTypes.Distributed;
                    }
                    else if (str == "just")
                    {
                        this.TextAnchoringType = TextAnchoringTypes.Justified;
                    }
                    else if (str == "t")
                    {
                        this.TextAnchoringType = TextAnchoringTypes.Top;
                    }
                    this.IsTextBoxAnchorCenter = element.GetAttributeValueOrDefaultOfBooleanType("anchorCtr", false);
                    this.CompatibleLineSpacing = element.GetAttributeValueOrDefaultOfBooleanType("compatLnSpc", false);
                    this.ForceAntiAlias        = element.GetAttributeValueOrDefaultOfBooleanType("forceAA", false);
                    this.FromWordArt           = element.GetAttributeValueOrDefaultOfBooleanType("fromWordArt", false);
                    if (element.GetAttributeValueOrDefaultOfStringType("horzOverflow", "overflow") == "clip")
                    {
                        this.TextHorizontalOverflow = Dt.Xls.Chart.TextHorizontalOverflow.Clip;
                    }
                    else
                    {
                        this.TextHorizontalOverflow = Dt.Xls.Chart.TextHorizontalOverflow.Overflow;
                    }
                    this.NumberOfColumns     = element.GetAttributeValueOrDefaultOfInt32Type("numCol", 1);
                    this.Rotation            = element.GetAttributeValueOrDefaultOfInt32Type("rot", 0) / 0xea60;
                    this.ColumnsRightToLeft  = element.GetAttributeValueOrDefaultOfBooleanType("rtlCol", false);
                    this.SpaceBetweenColumns = element.GetAttributeValueOrDefaultOfInt32Type("spcCol", 1);
                    this.ParagraphSpacing    = element.GetAttributeValueOrDefaultOfBooleanType("spcFirstLastPara", false);
                    this.UpRight             = element.GetAttributeValueOrDefaultOfBooleanType("upright", false);
                    string str3 = element.GetAttributeValueOrDefaultOfStringType("vert", "horz");
                    if (str3 == "horz")
                    {
                        this.VerticalText = TextVerticalTypes.Horizontal;
                    }
                    else if (str3 == "eaVert")
                    {
                        this.VerticalText = TextVerticalTypes.EastAsianVertical;
                    }
                    else if (str3 == "mongolianVert")
                    {
                        this.VerticalText = TextVerticalTypes.MongolianVertical;
                    }
                    else if (str3 == "vert270")
                    {
                        this.VerticalText = TextVerticalTypes.Vertical270;
                    }
                    else if (str3 == "wordArtVert")
                    {
                        this.VerticalText = TextVerticalTypes.WordArtVertical;
                    }
                    else if (str3 == "wordArtVertRtl")
                    {
                        this.VerticalText = TextVerticalTypes.VerticalWordArtRightToLeft;
                    }
                    switch (element.GetAttributeValueOrDefaultOfStringType("vertOverflow", "overflow"))
                    {
                    case "clip":
                        this.TextVerticalOverflow = TextOverflowTypes.Clip;
                        break;

                    case "ellipsis":
                        this.TextVerticalOverflow = TextOverflowTypes.Ellipsis;
                        break;

                    case "overflow":
                        this.TextVerticalOverflow = TextOverflowTypes.Overflow;
                        break;
                    }
                    string str5 = element.GetAttributeValueOrDefaultOfStringType("wrap", "square");
                    if (str5 == "none")
                    {
                        this.TextWrappingType = TextWrappingTypes.None;
                    }
                    else if (str5 == "square")
                    {
                        this.TextWrappingType = TextWrappingTypes.Square;
                    }
                    this.LeftInset   = (element.GetAttributeValueOrDefaultOfDoubleType("lIns", 91440.0) / 914400.0) * 72.0;
                    this.RightInset  = (element.GetAttributeValueOrDefaultOfDoubleType("rIns", 91440.0) / 914400.0) * 72.0;
                    this.TopInset    = (element.GetAttributeValueOrDefaultOfDoubleType("tIns", 45720.0) / 914400.0) * 72.0;
                    this.BottomInset = (element.GetAttributeValueOrDefaultOfDoubleType("bIns", 45720.0) / 914400.0) * 72.0;
                }
                if (element.Name.LocalName == "p")
                {
                    TextParagraph paragraph = new TextParagraph();
                    paragraph.ReadXml(element, mFolder, xFile);
                    this.TextParagraphs.Add(paragraph);
                }
            }
        }