Esempio n. 1
0
 private void method_37(ParagraphBase A_0, ParagraphBase A_1)
 {
     if ((A_0.OwnerParagraph.NextSibling != A_1.OwnerParagraph) && (A_0.OwnerParagraph.NextSibling != null))
     {
         Paragraph ownerParagraph = A_0.OwnerParagraph;
         Paragraph paragraph2     = A_1.OwnerParagraph;
         Table     ownerTable     = null;
         Table     table2         = null;
         if (base.OwnerParagraph.Owner is TableCell)
         {
             ownerTable = (base.OwnerParagraph.Owner as TableCell).OwnerRow.OwnerTable;
         }
         if (paragraph2.Owner is TableCell)
         {
             table2 = (paragraph2.Owner as TableCell).OwnerRow.OwnerTable;
         }
         while (ownerParagraph.NextSibling != A_1.OwnerParagraph)
         {
             if ((ownerParagraph.NextSibling == null) || (A_0.NextSibling == ownerTable))
             {
                 break;
             }
             if (A_0.NextSibling == table2)
             {
                 return;
             }
             (A_0.NextSibling as BodyRegion).RemoveSelf();
         }
     }
 }
Esempio n. 2
0
 internal void method_235()
 {
     for (int i = 0; i < this.TextItems.Count; i++)
     {
         ParagraphBase base2 = this.TextItems[i];
         base2.CharacterFormat.ApplyBase(this.CharacterFormat.BaseFormat);
     }
 }
Esempio n. 3
0
 public void AddItem(IParagraphBase paraItem)
 {
     if ((base.OwnerParagraph != null) && ((this.paragraphItemCollection_1 == null) || !this.paragraphItemCollection_1.Contains(paraItem)))
     {
         Paragraph ownerParagraph = base.OwnerParagraph;
         int       index          = base.method_5();
         if (this.m_format.CommentId == -1)
         {
             int num4 = Class323.smethod_0().Next();
             this.m_format.CommentId = num4;
             CommentMark entity = new CommentMark(base.m_doc, num4)
             {
                 Type = CommentMarkType.CommentStart
             };
             CommentMark mark3 = new CommentMark(base.m_doc, num4)
             {
                 Type = CommentMarkType.CommentEnd
             };
             ownerParagraph.Items.Insert(index, mark3);
             ownerParagraph.Items.Insert(index, entity);
         }
         index = base.method_5();
         if (ownerParagraph.Items[index - 1] is CommentMark)
         {
             int commentId = this.m_format.CommentId;
             if (paraItem.OwnerParagraph == null)
             {
                 this.method_32(ownerParagraph, index - 1, paraItem);
             }
             else if ((ownerParagraph.Items.Count > (index + 1)) && (paraItem == ownerParagraph.Items[index + 1]))
             {
                 ownerParagraph.Items.RemoveAt(index + 1);
                 this.method_32(ownerParagraph, index - 1, paraItem);
             }
             else
             {
                 CommentMark mark = this.method_33(index, commentId, ownerParagraph.Items);
                 if ((mark != null) && (paraItem == ownerParagraph.Items[mark.method_5() - 1]))
                 {
                     int num = mark.method_5();
                     ownerParagraph.Items.RemoveAt(num - 1);
                     this.method_32(ownerParagraph, num, paraItem);
                 }
                 else
                 {
                     ParagraphBase base2 = paraItem.Clone() as ParagraphBase;
                     this.method_32(ownerParagraph, index - 1, base2);
                 }
             }
         }
     }
 }
        protected override object CloneImpl()
        {
            ParagraphBase base2 = (ParagraphBase)base.CloneImpl();

            if (this.m_charFormat != null)
            {
                base2.m_charFormat = new Spire.Doc.Formatting.CharacterFormat(base.Document);
                base2.m_charFormat.ImportContainer(this.m_charFormat);
                base2.m_charFormat.method_21(this.m_charFormat);
                base2.m_charFormat.method_0(base2);
            }
            base2.interface23_0 = null;
            return(base2);
        }
Esempio n. 5
0
        private void method_38(ParagraphBase A_0, ParagraphBase A_1)
        {
            Paragraph ownerParagraph = A_0.OwnerParagraph;

            if (ownerParagraph.method_5() > 0)
            {
                A_0.RemoveSelf();
            }
            else
            {
                Table ownerTable = null;
                if (ownerParagraph.Owner is TableCell)
                {
                    ownerTable = (ownerParagraph.Owner as TableCell).OwnerRow.OwnerTable;
                }
                if (ownerTable == null)
                {
                    if (ownerParagraph.Items.Count > 1)
                    {
                        A_0.RemoveSelf();
                    }
                    else
                    {
                        ownerParagraph.RemoveSelf();
                    }
                }
                else
                {
                    Paragraph paragraph2 = A_1.OwnerParagraph;
                    Table     table2     = null;
                    if (paragraph2.Owner is TableCell)
                    {
                        table2 = (paragraph2.Owner as TableCell).OwnerRow.OwnerTable;
                    }
                    if ((ownerTable != table2) && (ownerParagraph.Owner == ownerTable.FirstRow.Cells[0]))
                    {
                        ownerTable.RemoveSelf();
                    }
                    else
                    {
                        A_0.RemoveSelf();
                    }
                }
            }
        }
Esempio n. 6
0
        private CommentMark method_33(int A_0, int A_1, ParagraphItemCollection A_2)
        {
            ParagraphBase base2 = null;

            for (int i = A_0; i > 0; i--)
            {
                base2 = A_2[i];
                if (base2 is CommentMark)
                {
                    CommentMark mark2 = base2 as CommentMark;
                    if ((mark2.Type == CommentMarkType.CommentStart) && (mark2.CommentId == A_1))
                    {
                        return(mark2);
                    }
                }
            }
            return(null);
        }
Esempio n. 7
0
 public void Clear()
 {
     if ((this.paragraphItemCollection_1 != null) && (this.paragraphItemCollection_1.Count != 0))
     {
         if (this.bool_7)
         {
             this.paragraphItemCollection_1.Clear();
             this.textBodyPart_0 = null;
         }
         else
         {
             ParagraphBase firstItem = this.paragraphItemCollection_1.FirstItem as ParagraphBase;
             ParagraphBase lastItem  = this.paragraphItemCollection_1.LastItem as ParagraphBase;
             this.method_31(firstItem, lastItem);
             this.Format.BookmarkStartOffset = 0;
             this.Format.BookmarkEndOffset   = 1;
             this.paragraphItemCollection_1.Clear();
             this.bool_7 = false;
         }
     }
 }
Esempio n. 8
0
        private bool method_35(Paragraph A_0)
        {
            bool flag;

            using (IEnumerator enumerator = A_0.Items.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    ParagraphBase current = (ParagraphBase)enumerator.Current;
                    if (current is Comment)
                    {
                        goto Label_002D;
                    }
                }
                return(true);

Label_002D:
                flag = false;
            }
            return(flag);
        }
Esempio n. 9
0
 internal void method_31(ParagraphBase A_0, ParagraphBase A_1)
 {
     if ((A_0.PreviousSibling != null) && (A_0.PreviousSibling is CommentMark))
     {
         A_0.OwnerParagraph.Items.Remove(A_0.PreviousSibling);
     }
     if ((A_1.NextSibling != null) && (A_1.NextSibling is CommentMark))
     {
         A_1.OwnerParagraph.Items.Remove(A_1.NextSibling);
     }
     if (A_0 != A_1)
     {
         if (A_0.OwnerParagraph != A_1.OwnerParagraph)
         {
             while ((A_0.OwnerParagraph.NextTextBodyItem != A_1.OwnerParagraph) && ((A_0.OwnerParagraph.NextTextBodyItem != null) && this.method_34(A_0.OwnerParagraph.NextTextBodyItem)))
             {
                 A_0.OwnerParagraph.NextTextBodyItem.RemoveSelf();
             }
         }
         while ((A_0.NextSibling != null) && ((A_0.NextSibling != A_1) && !(A_0.NextSibling is Comment)))
         {
             A_0.OwnerParagraph.Items.Remove(A_0.NextSibling);
         }
         while (A_1.PreviousSibling != null)
         {
             if ((A_1.PreviousSibling == A_0) || (A_0.NextSibling is Comment))
             {
                 break;
             }
             A_1.OwnerParagraph.Items.Remove(A_1.PreviousSibling);
         }
         this.method_37(A_0, A_1);
         this.method_38(A_0, A_1);
     }
     A_1.RemoveSelf();
 }