Beispiel #1
0
        // Token: 0x06003DA7 RID: 15783 RVA: 0x0011C4CC File Offset: 0x0011A6CC
        internal static void RemoveText(TextTreeRootTextBlock rootTextBlock, int offset, int count)
        {
            if (count == 0)
            {
                return;
            }
            int num;
            TextTreeTextBlock textTreeTextBlock = TextTreeText.FindBlock(rootTextBlock, offset, out num);

            if (textTreeTextBlock.Count == num)
            {
                textTreeTextBlock = (TextTreeTextBlock)textTreeTextBlock.GetNextNode();
                Invariant.Assert(textTreeTextBlock != null);
                num = 0;
            }
            int num2;
            TextTreeTextBlock textTreeTextBlock2 = TextTreeText.FindBlock(rootTextBlock, offset + count, out num2);
            int           num3;
            SplayTreeNode splayTreeNode;

            if (num > 0 || count < textTreeTextBlock.Count)
            {
                num3 = Math.Min(count, textTreeTextBlock.Count - num);
                textTreeTextBlock.RemoveText(num, num3);
                splayTreeNode = textTreeTextBlock.GetNextNode();
            }
            else
            {
                num3          = 0;
                splayTreeNode = textTreeTextBlock;
            }
            if (count > num3)
            {
                int           num4;
                SplayTreeNode splayTreeNode2;
                if (num2 < textTreeTextBlock2.Count)
                {
                    num4 = num2;
                    textTreeTextBlock2.RemoveText(0, num2);
                    splayTreeNode2 = textTreeTextBlock2.GetPreviousNode();
                }
                else
                {
                    num4           = 0;
                    splayTreeNode2 = textTreeTextBlock2;
                }
                if (num3 + num4 < count)
                {
                    TextTreeText.Remove((TextTreeTextBlock)splayTreeNode, (TextTreeTextBlock)splayTreeNode2);
                }
            }
        }