Esempio n. 1
0
        // Token: 0x0600190D RID: 6413 RVA: 0x000C7DFC File Offset: 0x000C5FFC
        public static bool IsIncludePictureField(ref ScratchBuffer scratch, out BufferString linkUrl)
        {
            int num    = 0;
            int length = scratch.Length;

            while (num != scratch.Length && ParseSupport.WhitespaceCharacter(ParseSupport.GetCharClass(scratch[num])))
            {
                num++;
            }
            if (scratch.Length - num > 15 && scratch[num] == 'I' && scratch[num + 1] == 'N' && scratch[num + 2] == 'C' && scratch[num + 3] == 'L' && scratch[num + 4] == 'U' && scratch[num + 5] == 'D' && scratch[num + 6] == 'E' && scratch[num + 7] == 'P' && scratch[num + 8] == 'I' && scratch[num + 9] == 'C' && scratch[num + 10] == 'T' && scratch[num + 11] == 'U' && scratch[num + 12] == 'R' && scratch[num + 13] == 'E' && scratch[num + 14] == ' ')
            {
                num += 15;
                int offset;
                int num2;
                int offset2;
                int num3;
                int fieldArgument = RtfSupport.GetFieldArgument(ref scratch, num, out offset, out num2, out offset2, out num3);
                while (num2 == 2 && scratch[offset] == '\\')
                {
                    num          += fieldArgument;
                    fieldArgument = RtfSupport.GetFieldArgument(ref scratch, num, out offset, out num2, out offset2, out num3);
                }
                if (num3 > 2)
                {
                    linkUrl = scratch.SubString(offset2, num3);
                    return(true);
                }
            }
            linkUrl = BufferString.Null;
            return(false);
        }
Esempio n. 2
0
        public int AppendFragment(int start, ref ScratchBuffer scratchBuffer, int maxLength)
        {
            int offset = this.text.Index(this.position) + 1 + start;
            int num    = Math.Min(this.EffectiveLength - start, maxLength);

            if (num != 0)
            {
                scratchBuffer.Append(this.text.Plane(this.position), offset, num);
            }
            return(num);
        }
Esempio n. 3
0
        // Token: 0x0600190F RID: 6415 RVA: 0x000C8238 File Offset: 0x000C6438
        private static int GetFieldArgument(ref ScratchBuffer scratch, int offset, out int rawResultOffset, out int rawResultLength, out int unescapedResultOffset, out int unescapedResultLength)
        {
            int  length = scratch.Length;
            bool flag   = false;
            int  num    = 0;

            while (offset < length && scratch[offset] == ' ')
            {
                offset++;
                num++;
            }
            if (offset < length && scratch[offset] == '"')
            {
                flag = true;
                offset++;
                num++;
            }
            rawResultOffset       = offset;
            rawResultLength       = 0;
            unescapedResultOffset = length;
            unescapedResultLength = 0;
            while (offset < length)
            {
                char c = scratch[offset];
                if ((c == '"' && flag) || (c == ' ' && !flag))
                {
                    num++;
                    break;
                }
                if (c == '\\')
                {
                    offset++;
                    num++;
                    rawResultLength++;
                    if (offset == length)
                    {
                        break;
                    }
                    c = scratch[offset];
                }
                if (scratch.Append(c, 5120) != 0)
                {
                    unescapedResultLength++;
                }
                rawResultLength++;
                offset++;
                num++;
            }
            scratch.Length = length;
            return(num);
        }
Esempio n. 4
0
        // Token: 0x0600190C RID: 6412 RVA: 0x000C7C8C File Offset: 0x000C5E8C
        public static bool IsHyperlinkField(ref ScratchBuffer scratch, out bool local, out BufferString linkUrl)
        {
            int num    = 0;
            int length = scratch.Length;

            while (num != scratch.Length && ParseSupport.WhitespaceCharacter(ParseSupport.GetCharClass(scratch[num])))
            {
                num++;
            }
            if (scratch.Length - num > 10 && scratch[num] == 'H' && scratch[num + 1] == 'Y' && scratch[num + 2] == 'P' && scratch[num + 3] == 'E' && scratch[num + 4] == 'R' && scratch[num + 5] == 'L' && scratch[num + 6] == 'I' && scratch[num + 7] == 'N' && scratch[num + 8] == 'K' && scratch[num + 9] == ' ')
            {
                num += 10;
                int num2;
                int num3;
                int num4;
                int num5;
                int fieldArgument = RtfSupport.GetFieldArgument(ref scratch, num, out num2, out num3, out num4, out num5);
                if (num3 == 2 && scratch[num2] == '\\' && scratch[num2 + 1] == 'l')
                {
                    local         = true;
                    num          += fieldArgument;
                    fieldArgument = RtfSupport.GetFieldArgument(ref scratch, num, out num2, out num3, out num4, out num5);
                }
                else
                {
                    local = false;
                }
                if (num5 != 0)
                {
                    if (local)
                    {
                        num4--;
                        num5++;
                        scratch[num4] = '#';
                    }
                    linkUrl = scratch.SubString(num4, num5);
                    return(true);
                }
            }
            local   = false;
            linkUrl = BufferString.Null;
            return(false);
        }
Esempio n. 5
0
        // Token: 0x06001910 RID: 6416 RVA: 0x000C8304 File Offset: 0x000C6504
        public static string StringFontNameFromScratch(ScratchBuffer scratch)
        {
            int num = 0;
            int num2;

            for (num2 = scratch.Length; num2 != 0; num2--)
            {
                if (scratch[num2 - 1] != ';' && !ParseSupport.WhitespaceCharacter(ParseSupport.GetCharClass(scratch[num2 - 1])))
                {
                    break;
                }
            }
            while (num2 != 0 && ParseSupport.WhitespaceCharacter(ParseSupport.GetCharClass(scratch[num])))
            {
                num++;
                num2--;
            }
            if (num2 != 0 && scratch[num] != '?')
            {
                return(scratch.ToString(num, num2));
            }
            return(null);
        }
Esempio n. 6
0
        // Token: 0x0600190E RID: 6414 RVA: 0x000C7F8C File Offset: 0x000C618C
        public static bool IsSymbolField(ref ScratchBuffer scratch, out TextMapping textMapping, out char symbol, out short points)
        {
            textMapping = TextMapping.Unicode;
            symbol      = '\0';
            points      = 0;
            int num    = 0;
            int length = scratch.Length;

            while (num != scratch.Length && ParseSupport.WhitespaceCharacter(ParseSupport.GetCharClass(scratch[num])))
            {
                num++;
            }
            if (scratch.Length - num <= 7 || scratch[num] != 'S' || scratch[num + 1] != 'Y' || scratch[num + 2] != 'M' || scratch[num + 3] != 'B' || scratch[num + 4] != 'O' || scratch[num + 5] != 'L' || scratch[num + 6] != ' ')
            {
                return(false);
            }
            num += 7;
            int  num2;
            int  num3;
            int  num4;
            int  num5;
            int  fieldArgument = RtfSupport.GetFieldArgument(ref scratch, num, out num2, out num3, out num4, out num5);
            int  num6;
            char c;

            if (num3 > 2 && scratch.Buffer[num2] == '0' && (ushort)(scratch.Buffer[num2 + 1] | ' ') == 120)
            {
                num6 = 2;
                while (num6 < num3 && (c = scratch.Buffer[num2 + num6]) <= 'f')
                {
                    if (('0' > c || c > '9') && ('a' > c || c > 'f'))
                    {
                        if ('A' > c)
                        {
                            break;
                        }
                        if (c > 'F')
                        {
                            break;
                        }
                    }
                    symbol = (symbol << 4) + ((c <= '9') ? (c - '0') : ((c & 'O') - 'A' + '\n'));
                    num6++;
                }
            }
            else
            {
                num6 = 0;
                while (num6 < num3 && (c = scratch.Buffer[num2 + num6]) <= '9' && '0' <= c)
                {
                    symbol = '\n' * symbol + (c - '0');
                    num6++;
                }
            }
            num          += fieldArgument;
            fieldArgument = RtfSupport.GetFieldArgument(ref scratch, num, out num2, out num3, out num4, out num5);
            if (num3 != 2 || scratch[num2] != '\\' || scratch[num2 + 1] != 'f')
            {
                return(false);
            }
            num          += fieldArgument;
            fieldArgument = RtfSupport.GetFieldArgument(ref scratch, num, out num2, out num3, out num4, out num5);
            if (num5 == 0)
            {
                return(false);
            }
            RecognizeInterestingFontName recognizeInterestingFontName = default(RecognizeInterestingFontName);

            num6 = 0;
            while (num6 < num5 && !recognizeInterestingFontName.IsRejected)
            {
                recognizeInterestingFontName.AddCharacter(scratch.Buffer[num4 + num6]);
                num6++;
            }
            textMapping = recognizeInterestingFontName.TextMapping;
            if (textMapping == TextMapping.Unicode)
            {
                textMapping = TextMapping.OtherSymbol;
            }
            num          += fieldArgument;
            fieldArgument = RtfSupport.GetFieldArgument(ref scratch, num, out num2, out num3, out num4, out num5);
            if (num3 != 2 || scratch[num2] != '\\' || scratch[num2 + 1] != 's')
            {
                return(true);
            }
            num          += fieldArgument;
            fieldArgument = RtfSupport.GetFieldArgument(ref scratch, num, out num2, out num3, out num4, out num5);
            num6          = 0;
            while (num6 < num3 && (c = scratch.Buffer[num2 + num6]) <= '9' && '0' <= c)
            {
                points = 10 * points + (short)(c - '0');
                num6++;
            }
            return(true);
        }