Ejemplo n.º 1
0
        // Token: 0x0600173D RID: 5949 RVA: 0x000B4F28 File Offset: 0x000B3128
        private void EndGroup()
        {
            RtfDestination destination = this.state.Destination;

            switch (destination)
            {
            case RtfDestination.Field:
                if (this.state.ParentDestination != RtfDestination.Field)
                {
                    this.skipFieldResult = false;
                    if (this.includePictureField)
                    {
                        PropertyValue propertyValue  = new PropertyValue(LengthUnits.Twips, this.pictureHeight);
                        PropertyValue propertyValue2 = new PropertyValue(LengthUnits.Twips, this.pictureWidth);
                        this.output.OutputImage(this.imageUrl, this.imageAltText, propertyValue2.PixelsInteger, propertyValue.PixelsInteger);
                        this.includePictureField = false;
                        this.imageUrl            = null;
                        this.imageAltText        = null;
                        return;
                    }
                    if (this.hyperLinkActive)
                    {
                        if (!this.urlCompareSink.IsMatch)
                        {
                            this.output.CloseAnchor();
                        }
                        else
                        {
                            this.output.CancelAnchor();
                        }
                        this.hyperLinkActive = false;
                    }
                }
                break;

            case RtfDestination.FieldResult:
                break;

            case RtfDestination.FieldInstruction:
                if (this.state.ParentDestination == RtfDestination.Field)
                {
                    bool         flag;
                    BufferString bufferString;
                    TextMapping  textMapping;
                    char         ucs32Literal;
                    short        num;
                    if (RtfSupport.IsHyperlinkField(ref this.scratch, out flag, out bufferString))
                    {
                        if (!flag)
                        {
                            if (this.hyperLinkActive)
                            {
                                if (!this.urlCompareSink.IsMatch)
                                {
                                    this.output.CloseAnchor();
                                }
                                else
                                {
                                    this.output.CancelAnchor();
                                }
                                this.hyperLinkActive = false;
                                this.urlCompareSink.Reset();
                            }
                            bufferString.TrimWhitespace();
                            if (bufferString.Length != 0)
                            {
                                string text = bufferString.ToString();
                                this.output.OpenAnchor(text);
                                this.hyperLinkActive = true;
                                if (this.urlCompareSink == null)
                                {
                                    this.urlCompareSink = new UrlCompareSink();
                                }
                                this.urlCompareSink.Initialize(text);
                            }
                        }
                    }
                    else if (RtfSupport.IsIncludePictureField(ref this.scratch, out bufferString))
                    {
                        bufferString.TrimWhitespace();
                        if (bufferString.Length != 0)
                        {
                            this.includePictureField = true;
                            bufferString.TrimWhitespace();
                            if (bufferString.Length != 0)
                            {
                                this.imageUrl = bufferString.ToString();
                            }
                            this.pictureWidth  = 0;
                            this.pictureHeight = 0;
                        }
                    }
                    else if (RtfSupport.IsSymbolField(ref this.scratch, out textMapping, out ucs32Literal, out num))
                    {
                        if (this.output.LineEmpty && this.lineIndent >= 120 && this.lineIndent < 7200)
                        {
                            this.output.OutputSpace(this.lineIndent / 120);
                        }
                        this.output.OutputNonspace((int)ucs32Literal, textMapping);
                        this.skipFieldResult = true;
                    }
                    this.scratch.Reset();
                    return;
                }
                break;

            default:
                switch (destination)
                {
                case RtfDestination.Picture:
                    if (this.state.ParentDestination != RtfDestination.Picture && !this.includePictureField)
                    {
                        PropertyValue propertyValue3 = new PropertyValue(LengthUnits.Twips, this.pictureHeight);
                        PropertyValue propertyValue4 = new PropertyValue(LengthUnits.Twips, this.pictureWidth);
                        this.output.OutputImage(null, null, propertyValue4.PixelsInteger, propertyValue3.PixelsInteger);
                        return;
                    }
                    break;

                case RtfDestination.PictureProperties:
                    break;

                case RtfDestination.ShapeName:
                    if (this.state.ParentDestination != RtfDestination.ShapeName)
                    {
                        BufferString bufferString2 = this.scratch.BufferString;
                        bufferString2.TrimWhitespace();
                        this.descriptionProperty = bufferString2.EqualsToLowerCaseStringIgnoreCase("wzdescription");
                        this.scratch.Reset();
                        return;
                    }
                    break;

                case RtfDestination.ShapeValue:
                    if (this.state.ParentDestination != RtfDestination.ShapeValue && this.descriptionProperty)
                    {
                        BufferString bufferString3 = this.scratch.BufferString;
                        bufferString3.TrimWhitespace();
                        if (bufferString3.Length != 0)
                        {
                            this.imageAltText = bufferString3.ToString();
                        }
                        this.scratch.Reset();
                        return;
                    }
                    break;

                default:
                    return;
                }
                break;
            }
        }