Ejemplo n.º 1
0
    private void method_118()
    {
        bool            flag2;
        int             num    = 0x10;
        ParagraphFormat format = this.paragraph_0.Format;
        ParagraphStyle  style  = this.paragraph_0.GetStyle();

        if (style == null)
        {
            style = this.paragraph_0.Document.Styles.FindByName(BookmarkStart.b("砵圷䠹儻弽ⰿ", num)) as ParagraphStyle;
        }
        if (format.HasValue(0x488))
        {
            base.Interface22.imethod_1().method_1((double)format.LeftIndent);
        }
        else if (this.paragraph_0.ListFormat.IsEmptyList)
        {
            base.Interface22.imethod_1().method_1(0.0);
        }
        else
        {
            base.Interface22.imethod_1().method_1((double)format.LeftIndent);
        }
        base.method_22(format.BeforeSpacing);
        base.method_24(format.AfterSpacing);
        base.Interface22.imethod_1().method_9((double)format.RightIndent);
        base.Interface22.imethod_1().method_5((double)base.method_21());
        base.Interface22.imethod_1().method_13((double)base.method_23());
        if (format.BeforeAutoSpacing)
        {
            base.Interface22.imethod_1().method_5(14.5);
        }
        if (format.AfterAutoSpacing)
        {
            base.Interface22.imethod_1().method_13(14.5);
        }
        IDocumentObject previousSibling = this.paragraph_0.PreviousSibling;

        if (((previousSibling == null) && !(this.paragraph_0.Owner is SDTContent)) && !this.paragraph_0.IsInCell)
        {
            Section section = this.paragraph_0.method_49().PreviousSibling as Section;
            previousSibling = (section != null) ? section.Body.ChildObjects.LastItem : previousSibling;
        }
        Paragraph       paragraph   = (previousSibling is StructureDocumentTag) ? ((previousSibling as StructureDocumentTag).ChildObjects.LastItem as Paragraph) : (previousSibling as Paragraph);
        IDocumentObject nextSibling = this.paragraph_0.NextSibling;
        Paragraph       paragraph2  = (nextSibling is StructureDocumentTag) ? ((nextSibling as StructureDocumentTag).ChildObjects.FirstItem as Paragraph) : (nextSibling as Paragraph);

        if (flag2 = paragraph != null)
        {
            if (this.paragraph_0.Format.IsFrame && !paragraph.Format.IsFrame)
            {
                flag2 = false;
            }
            else if (!this.paragraph_0.Format.IsFrame && paragraph.Format.IsFrame)
            {
                while (paragraph != null)
                {
                    if (!paragraph.Format.IsFrame)
                    {
                        break;
                    }
                    paragraph = (paragraph.PreviousSibling is StructureDocumentTag) ? ((paragraph.PreviousSibling as StructureDocumentTag).ChildObjects.LastItem as Paragraph) : (paragraph.PreviousSibling as Paragraph);
                }
                if (paragraph == null)
                {
                    flag2 = false;
                }
            }
        }
        if (flag2)
        {
            if (this.paragraph_0.Format.BeforeAutoSpacing && paragraph.Format.AfterAutoSpacing)
            {
                base.Interface22.imethod_1().method_5(0.0);
            }
            else if (!this.paragraph_0.Format.BeforeAutoSpacing && paragraph.Format.AfterAutoSpacing)
            {
                if (14.5f >= this.paragraph_0.Format.BeforeSpacing)
                {
                    base.Interface22.imethod_1().method_5(0.0);
                }
                else
                {
                    base.Interface22.imethod_1().method_5((double)(this.paragraph_0.Format.BeforeSpacing - 14.5f));
                }
            }
            else if (this.paragraph_0.Format.BeforeAutoSpacing && !paragraph.Format.AfterAutoSpacing)
            {
                if (paragraph.Format.AfterSpacing >= 14.5f)
                {
                    base.Interface22.imethod_1().method_5(0.0);
                }
                else
                {
                    base.Interface22.imethod_1().method_5((double)(14.5f - paragraph.Format.AfterSpacing));
                }
            }
            else if (((paragraph.interface23_0 != null) && (paragraph.interface23_0 as Class213).method_81()) && (paragraph.interface23_0 as Class213).Interface23.imethod_40())
            {
                base.Interface22.imethod_1().method_5((double)this.paragraph_0.Format.BeforeSpacing);
            }
            else if (paragraph.Format.AfterSpacing >= this.paragraph_0.Format.BeforeSpacing)
            {
                base.Interface22.imethod_1().method_5(0.0);
            }
            else
            {
                base.Interface22.imethod_1().method_5((double)(this.paragraph_0.Format.BeforeSpacing - paragraph.Format.AfterSpacing));
            }
        }
        if ((((paragraph2 != null) && this.paragraph_0.Format.AfterAutoSpacing) && ((this.paragraph_0.ListFormat.ListType != ListType.NoList) && (paragraph2.ListFormat.ListType != ListType.NoList))) && (((this.paragraph_0.ListFormat.CurrentListLevel != null) && (paragraph2.ListFormat.CurrentListLevel != null)) && (this.paragraph_0.ListFormat.CustomStyleName == paragraph2.ListFormat.CustomStyleName)))
        {
            base.Interface22.imethod_1().method_13(0.0);
        }
        if (this.paragraph_0.IsInCell)
        {
            TableCell owner = this.paragraph_0.Owner as TableCell;
            if (owner != null)
            {
                int count = owner.ChildObjects.Count;
                int index = owner.ChildObjects.IndexOf(this.paragraph_0);
                if (((count > 0) && (index == 0)) && this.paragraph_0.Format.BeforeAutoSpacing)
                {
                    base.Interface22.imethod_1().method_5(0.0);
                }
                if (((count > 0) && (index == (count - 1))) && (this.paragraph_0.Format.AfterAutoSpacing && (this.paragraph_0.ListFormat.ListType == ListType.NoList)))
                {
                    base.Interface22.imethod_1().method_13(0.0);
                }
            }
        }
        if (format.IsContextualSpacing)
        {
            Paragraph paragraph3 = (this.paragraph_0.PreviousSibling != null) ? ((this.paragraph_0.PreviousSibling is Paragraph) ? (this.paragraph_0.PreviousSibling as Paragraph) : ((this.paragraph_0.PreviousSibling is Table) ? ((this.paragraph_0.PreviousSibling as Table).FirstRow.Cells[0].ChildObjects[0] as Paragraph) : null)) : null;
            Paragraph paragraph4 = (this.paragraph_0.NextSibling != null) ? ((this.paragraph_0.NextSibling is Paragraph) ? (this.paragraph_0.NextSibling as Paragraph) : ((this.paragraph_0.NextSibling is Table) ? ((this.paragraph_0.NextSibling as Table).FirstRow.Cells[0].ChildObjects[0] as Paragraph) : null)) : null;
            bool      flag       = this.paragraph_0.Document.Settings.method_5().method_0(CompatibilityOptions.AllowSpaceOfSameStyleInTable);
            if ((paragraph3 == null) || (paragraph3.StyleName == this.paragraph_0.StyleName))
            {
                if (this.paragraph_0.IsInCell)
                {
                    if (!flag)
                    {
                        base.Interface22.imethod_1().method_5(0.0);
                    }
                }
                else
                {
                    base.Interface22.imethod_1().method_5(0.0);
                }
            }
            if ((paragraph4 == null) || (paragraph4.StyleName == this.paragraph_0.StyleName))
            {
                if (this.paragraph_0.IsInCell)
                {
                    if (!flag)
                    {
                        base.Interface22.imethod_1().method_13(0.0);
                    }
                }
                else if (this.paragraph_0.NextSibling != null)
                {
                    base.Interface22.imethod_1().method_13(0.0);
                }
            }
        }
        base.method_40(format.KeepLines);
        base.method_36(format.KeepFollow);
        base.method_42(format.IsWidowControl);
        if (format.HasKey(0x492) && format.HasValue(0x492))
        {
            base.method_20(format.FirstLineIndent);
        }
        else if ((style != null) && (style.ParagraphFormat != null))
        {
            base.method_20(format.FirstLineIndent);
        }
        else
        {
            base.method_20(format.FirstLineIndent);
        }
        base.method_54(this.paragraph_0.Format.LineSpacing);
        base.method_56(this.paragraph_0.Format.LineSpacingRule);
        base.method_18(format.HorizontalAlignment);
        base.method_16((HorizontalAlignment)base.method_17());
        base.method_26(format.AutoSpaceDE);
        base.method_28(format.AutoSpaceDN);
        if (format.IsBidi)
        {
            if (base.method_15() == HorizontalAlignment.Left)
            {
                base.method_16(HorizontalAlignment.Right);
            }
            else if (base.method_15() == HorizontalAlignment.Right)
            {
                base.method_16(HorizontalAlignment.Left);
            }
        }
        if (this.paragraph_0.SectionEndMark)
        {
            base.Interface22.imethod_1().method_5(0.0);
            if ((this.paragraph_0.ChildObjects.Count == 0) && (this.paragraph_0.OwnerTextBody.ChildObjects.Count > 1))
            {
                base.Interface22.imethod_1().method_13(0.0);
            }
        }
    }