コード例 #1
0
        internal DocPicture method_63(bool A_0)
        {
            Paragraph owner = base.Owner as Paragraph;

            owner = (owner != null) ? owner : base.method_28();
            Document document      = base.Document;
            float    heightPercent = this.HeightPercent;

            if (this.HeightPercent > 0f)
            {
                float num = this.method_67(base.RelativeHeight, this.HeightPercent);
                if ((num > 0f) && (base.Height != num))
                {
                    base.Height = num;
                }
            }
            float widthPercent = this.WidthPercent;

            if (this.WidthPercent > 0f)
            {
                float num2 = this.method_68(base.RelativeWidth, this.WidthPercent);
                if ((num2 > 0f) && (num2 != base.Width))
                {
                    base.Width = num2;
                }
            }
            if ((base.LeftPercent != null) && (((float)base.LeftPercent) != 0f))
            {
                float num3 = this.method_65(this.HorizontalOrigin, (float)base.LeftPercent);
                if ((num3 != 0f) && (base.Left != num3))
                {
                    base.Left = num3;
                }
            }
            if ((base.TopPercent != null) && (((float)base.TopPercent) != 0f))
            {
                float num4 = this.method_66(this.VerticalOrigin, (float)base.TopPercent);
                if ((num4 != 0f) && (base.Top != num4))
                {
                    base.Top = num4;
                }
            }
            if (!A_0 && !this.CompleteExtractionOfEmbeddedTextbox)
            {
                int num5 = this.method_64(this, this, owner);
                int num6 = num5;
                this.method_70(owner, this, ref num5);
                this.CompleteExtractionOfEmbeddedTextbox = true;
                if (num6 != num5)
                {
                    document.LayoutVariables.method_0().Add(owner);
                }
            }
            DocPicture picture = new DocPicture(base.Document, base.Clone() as ShapeObject)
            {
                ShapeInfo = this
            };

            picture.method_0(base.Owner);
            picture.Height             = (float)base.Height;
            picture.Width              = (float)base.Width;
            picture.HorizontalPosition = (base.Owner.DocumentObjectType == Spire.Doc.Documents.DocumentObjectType.ShapeGroup) ? (((float)base.Left) / 20f) : ((float)base.Left);
            picture.VerticalPosition   = (base.Owner.DocumentObjectType == Spire.Doc.Documents.DocumentObjectType.ShapeGroup) ? (((float)base.Top) / 20f) : ((float)base.Top);
            if (base.IsHorizontalRule)
            {
                DocumentObject obj2 = base.Owner;
                while (obj2 != null)
                {
                    if (obj2 is Section)
                    {
                        break;
                    }
                    obj2 = obj2.Owner;
                }
                if (obj2 is Section)
                {
                    float clientWidth = (obj2 as Section).PageSetup.ClientWidth;
                    if (this.HorizontalRule.method_8() > 0.0)
                    {
                        float num8 = (float)((clientWidth * this.HorizontalRule.method_8()) / 100.0);
                        picture.Width = num8;
                        base.Width    = num8;
                    }
                    switch (this.HorizontalRule.method_6())
                    {
                    case ShapeHorizontalAlignment.Center:
                        picture.HorizontalPosition = (clientWidth - picture.Width) / 2f;
                        break;

                    case ShapeHorizontalAlignment.Right:
                        picture.HorizontalPosition = picture.Width - clientWidth;
                        break;
                    }
                }
            }
            picture.TextWrappingStyle   = this.TextWrappingStyleEx;
            picture.OwnerHyperlinkField = this.OwnerHyperlinkField;
            return(picture);
        }