private void ArrangeSection(ref PTS.FSSECTIONDESCRIPTION sectionDesc)
 {
     PTS.FSSECTIONDETAILS fssectiondetails;
     PTS.Validate(PTS.FsQuerySectionDetails(this.PtsContext.Context, sectionDesc.pfssection, out fssectiondetails));
     if (PTS.ToBoolean(fssectiondetails.fFootnotesAsPagenotes))
     {
         ErrorHandler.Assert(fssectiondetails.u.withpagenotes.cEndnoteColumns == 0, ErrorHandler.NotSupportedFootnotes);
         if (fssectiondetails.u.withpagenotes.cBasicColumns != 0)
         {
             PTS.FSTRACKDESCRIPTION[] array;
             PtsHelper.TrackListFromSection(this.PtsContext, sectionDesc.pfssection, ref fssectiondetails, out array);
             for (int i = 0; i < array.Length; i++)
             {
                 this._section.StructuralCache.CurrentArrangeContext.PushNewPageData(this._pageContextOfThisPage, array[i].fsrc, this._finitePage);
                 PtsHelper.ArrangeTrack(this.PtsContext, ref array[i], fssectiondetails.u.withpagenotes.fswdir);
                 this._section.StructuralCache.CurrentArrangeContext.PopPageData();
             }
             return;
         }
     }
     else
     {
         ErrorHandler.Assert(false, ErrorHandler.NotSupportedCompositeColumns);
     }
 }
 internal void ArrangePage()
 {
     if (this.IsEmpty)
     {
         return;
     }
     this._section.UpdateSegmentLastFormatPositions();
     PTS.FSPAGEDETAILS fspagedetails;
     PTS.Validate(PTS.FsQueryPageDetails(this.PtsContext.Context, this._ptsPage.Value, out fspagedetails));
     if (PTS.ToBoolean(fspagedetails.fSimple))
     {
         this._section.StructuralCache.CurrentArrangeContext.PushNewPageData(this._pageContextOfThisPage, fspagedetails.u.simple.trackdescr.fsrc, this._finitePage);
         PtsHelper.ArrangeTrack(this.PtsContext, ref fspagedetails.u.simple.trackdescr, PTS.FlowDirectionToFswdir(this._section.StructuralCache.PageFlowDirection));
         this._section.StructuralCache.CurrentArrangeContext.PopPageData();
         return;
     }
     ErrorHandler.Assert(fspagedetails.u.complex.cFootnoteColumns == 0, ErrorHandler.NotSupportedFootnotes);
     if (fspagedetails.u.complex.cSections != 0)
     {
         PTS.FSSECTIONDESCRIPTION[] array;
         PtsHelper.SectionListFromPage(this.PtsContext, this._ptsPage.Value, ref fspagedetails, out array);
         for (int i = 0; i < array.Length; i++)
         {
             this.ArrangeSection(ref array[i]);
         }
     }
 }
 protected override void OnArrange()
 {
     base.OnArrange();
     ((FloaterParagraph)base.Paragraph).UpdateSegmentLastFormatPositions();
     PTS.FSSUBPAGEDETAILS fssubpagedetails;
     PTS.Validate(PTS.FsQuerySubpageDetails(base.PtsContext.Context, this._paraHandle.Value, out fssubpagedetails));
     this._pageContext.AddFloatingParaClient(this);
     if (PTS.ToBoolean(fssubpagedetails.fSimple))
     {
         this._pageContextOfThisPage.PageRect = new PTS.FSRECT(fssubpagedetails.u.simple.trackdescr.fsrc);
         base.Paragraph.StructuralCache.CurrentArrangeContext.PushNewPageData(this._pageContextOfThisPage, fssubpagedetails.u.simple.trackdescr.fsrc, base.Paragraph.StructuralCache.CurrentArrangeContext.FinitePage);
         PtsHelper.ArrangeTrack(base.PtsContext, ref fssubpagedetails.u.simple.trackdescr, fssubpagedetails.u.simple.fswdir);
         base.Paragraph.StructuralCache.CurrentArrangeContext.PopPageData();
         return;
     }
     this._pageContextOfThisPage.PageRect = new PTS.FSRECT(fssubpagedetails.u.complex.fsrc);
     if (fssubpagedetails.u.complex.cBasicColumns != 0)
     {
         PTS.FSTRACKDESCRIPTION[] array;
         PtsHelper.TrackListFromSubpage(base.PtsContext, this._paraHandle.Value, ref fssubpagedetails, out array);
         for (int i = 0; i < array.Length; i++)
         {
             base.Paragraph.StructuralCache.CurrentArrangeContext.PushNewPageData(this._pageContextOfThisPage, array[i].fsrc, base.Paragraph.StructuralCache.CurrentArrangeContext.FinitePage);
             PtsHelper.ArrangeTrack(base.PtsContext, ref array[i], fssubpagedetails.u.complex.fswdir);
             base.Paragraph.StructuralCache.CurrentArrangeContext.PopPageData();
         }
     }
 }
Пример #4
0
        protected override void OnArrange()
        {
            base.OnArrange();

            ((FloaterParagraph)Paragraph).UpdateSegmentLastFormatPositions();

            // Query subpage details
            PTS.FSSUBPAGEDETAILS subpageDetails;
            PTS.Validate(PTS.FsQuerySubpageDetails(PtsContext.Context, _paraHandle.Value, out subpageDetails));

            _pageContext.AddFloatingParaClient(this);

            // Arrange subpage content. Subpage content may be simple or complex -
            // depending of set of features used in the content of the subpage.
            // (1) simple subpage (contains only one track)
            // (2) complex subpage (contains columns)
            if (PTS.ToBoolean(subpageDetails.fSimple))
            {
                _pageContextOfThisPage.PageRect = new PTS.FSRECT(subpageDetails.u.simple.trackdescr.fsrc);

                // (1) simple subpage (contains only one track)
                // Exceptions don't need to pop, as the top level arrange context will be nulled out if thrown.
                Paragraph.StructuralCache.CurrentArrangeContext.PushNewPageData(_pageContextOfThisPage, subpageDetails.u.simple.trackdescr.fsrc,
                                                                                Paragraph.StructuralCache.CurrentArrangeContext.FinitePage);

                PtsHelper.ArrangeTrack(PtsContext, ref subpageDetails.u.simple.trackdescr, subpageDetails.u.simple.fswdir);

                Paragraph.StructuralCache.CurrentArrangeContext.PopPageData();
            }
            else
            {
                _pageContextOfThisPage.PageRect = new PTS.FSRECT(subpageDetails.u.complex.fsrc);

                // (2) complex page (contains columns)
                // cBasicColumns == 0, means that subpage content is empty
                if (subpageDetails.u.complex.cBasicColumns != 0)
                {
                    // Retrieve description for each column.
                    PTS.FSTRACKDESCRIPTION[] arrayColumnDesc;
                    PtsHelper.TrackListFromSubpage(PtsContext, _paraHandle.Value, ref subpageDetails, out arrayColumnDesc);

                    // Arrange each track
                    for (int index = 0; index < arrayColumnDesc.Length; index++)
                    {
                        // Exceptions don't need to pop, as the top level arrange context will be nulled out if thrown.
                        Paragraph.StructuralCache.CurrentArrangeContext.PushNewPageData(_pageContextOfThisPage, arrayColumnDesc[index].fsrc,
                                                                                        Paragraph.StructuralCache.CurrentArrangeContext.FinitePage);

                        PtsHelper.ArrangeTrack(PtsContext, ref arrayColumnDesc[index], subpageDetails.u.complex.fswdir);

                        Paragraph.StructuralCache.CurrentArrangeContext.PopPageData();
                    }
                }
            }
        }
Пример #5
0
        protected override void OnArrange()
        {
            base.OnArrange();
            ((SubpageParagraph)base.Paragraph).UpdateSegmentLastFormatPositions();
            PTS.FSSUBPAGEDETAILS fssubpagedetails;
            PTS.Validate(PTS.FsQuerySubpageDetails(base.PtsContext.Context, this._paraHandle.Value, out fssubpagedetails));
            MbpInfo mbpInfo = MbpInfo.FromElement(base.Paragraph.Element, base.Paragraph.StructuralCache.TextFormatterHost.PixelsPerDip);

            if (base.ThisFlowDirection != base.PageFlowDirection)
            {
                mbpInfo.MirrorBP();
            }
            if (!this.IsFirstChunk)
            {
                mbpInfo.Border  = new Thickness(mbpInfo.Border.Left, 0.0, mbpInfo.Border.Right, mbpInfo.Border.Bottom);
                mbpInfo.Padding = new Thickness(mbpInfo.Padding.Left, 0.0, mbpInfo.Padding.Right, mbpInfo.Padding.Bottom);
            }
            if (!this.IsLastChunk)
            {
                mbpInfo.Border  = new Thickness(mbpInfo.Border.Left, mbpInfo.Border.Top, mbpInfo.Border.Right, 0.0);
                mbpInfo.Padding = new Thickness(mbpInfo.Padding.Left, mbpInfo.Padding.Top, mbpInfo.Padding.Right, 0.0);
            }
            this._contentRect.u  = this._rect.u + mbpInfo.BPLeft;
            this._contentRect.du = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), this._rect.du - mbpInfo.BPRight - mbpInfo.BPLeft);
            this._contentRect.v  = this._rect.v + mbpInfo.BPTop;
            this._contentRect.dv = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), this._rect.dv - mbpInfo.BPBottom - mbpInfo.BPTop);
            this._paddingRect.u  = this._rect.u + mbpInfo.BorderLeft;
            this._paddingRect.du = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), this._rect.du - mbpInfo.BorderRight - mbpInfo.BorderLeft);
            this._paddingRect.v  = this._rect.v + mbpInfo.BorderTop;
            this._paddingRect.dv = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), this._rect.dv - mbpInfo.BorderBottom - mbpInfo.BorderTop);
            if (PTS.ToBoolean(fssubpagedetails.fSimple))
            {
                this._pageContextOfThisPage.PageRect = new PTS.FSRECT(fssubpagedetails.u.simple.trackdescr.fsrc);
                base.Paragraph.StructuralCache.CurrentArrangeContext.PushNewPageData(this._pageContextOfThisPage, fssubpagedetails.u.simple.trackdescr.fsrc, base.Paragraph.StructuralCache.CurrentArrangeContext.FinitePage);
                PtsHelper.ArrangeTrack(base.PtsContext, ref fssubpagedetails.u.simple.trackdescr, fssubpagedetails.u.simple.fswdir);
                base.Paragraph.StructuralCache.CurrentArrangeContext.PopPageData();
                return;
            }
            this._pageContextOfThisPage.PageRect = new PTS.FSRECT(fssubpagedetails.u.complex.fsrc);
            if (fssubpagedetails.u.complex.cBasicColumns != 0)
            {
                PTS.FSTRACKDESCRIPTION[] array;
                PtsHelper.TrackListFromSubpage(base.PtsContext, this._paraHandle.Value, ref fssubpagedetails, out array);
                for (int i = 0; i < array.Length; i++)
                {
                    base.Paragraph.StructuralCache.CurrentArrangeContext.PushNewPageData(this._pageContextOfThisPage, array[i].fsrc, base.Paragraph.StructuralCache.CurrentArrangeContext.FinitePage);
                    PtsHelper.ArrangeTrack(base.PtsContext, ref array[i], fssubpagedetails.u.complex.fswdir);
                    base.Paragraph.StructuralCache.CurrentArrangeContext.PopPageData();
                }
            }
        }
        protected override void OnArrange()
        {
            base.OnArrange();

            ((FigureParagraph)Paragraph).UpdateSegmentLastFormatPositions();

            // Query subpage details
            PTS.FSSUBPAGEDETAILS subpageDetails;
            PTS.Validate(PTS.FsQuerySubpageDetails(PtsContext.Context, _paraHandle.Value, out subpageDetails));

            _pageContext.AddFloatingParaClient(this);

            MbpInfo mbp = MbpInfo.FromElement(Paragraph.Element);

            if (ThisFlowDirection != PageFlowDirection)
            {
                mbp.MirrorBP();
            }

            _contentRect.u  = _rect.u + mbp.BPLeft;
            _contentRect.du = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), _rect.du - mbp.BPRight - mbp.BPLeft);
            _contentRect.v  = _rect.v + mbp.BPTop;
            _contentRect.dv = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), _rect.dv - mbp.BPBottom - mbp.BPTop);

            _paddingRect.u  = _rect.u + mbp.BorderLeft;
            _paddingRect.du = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), _rect.du - mbp.BorderRight - mbp.BorderLeft);
            _paddingRect.v  = _rect.v + mbp.BorderTop;
            _paddingRect.dv = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), _rect.dv - mbp.BorderBottom - mbp.BorderTop);


            // Arrange subpage content. Subpage content may be simple or complex -
            // depending of set of features used in the content of the subpage.
            // (1) simple subpage (contains only one track)
            // (2) complex subpage (contains columns)
            if (PTS.ToBoolean(subpageDetails.fSimple))
            {
                _pageContextOfThisPage.PageRect = new PTS.FSRECT(subpageDetails.u.simple.trackdescr.fsrc);

                // (1) simple subpage (contains only one track)
                // Exceptions don't need to pop, as the top level arrange context will be nulled out if thrown.
                Paragraph.StructuralCache.CurrentArrangeContext.PushNewPageData(_pageContextOfThisPage, subpageDetails.u.simple.trackdescr.fsrc,
                                                                                Paragraph.StructuralCache.CurrentArrangeContext.FinitePage);

                PtsHelper.ArrangeTrack(PtsContext, ref subpageDetails.u.simple.trackdescr, subpageDetails.u.simple.fswdir);

                Paragraph.StructuralCache.CurrentArrangeContext.PopPageData();
            }
            else
            {
                _pageContextOfThisPage.PageRect = new PTS.FSRECT(subpageDetails.u.complex.fsrc);

                // (2) complex page (contains columns)
                // cBasicColumns == 0, means that subpage content is empty
                if (subpageDetails.u.complex.cBasicColumns != 0)
                {
                    // Retrieve description for each column.
                    PTS.FSTRACKDESCRIPTION[] arrayColumnDesc;
                    PtsHelper.TrackListFromSubpage(PtsContext, _paraHandle.Value, ref subpageDetails, out arrayColumnDesc);

                    // Arrange each track
                    for (int index = 0; index < arrayColumnDesc.Length; index++)
                    {
                        // Exceptions don't need to pop, as the top level arrange context will be nulled out if thrown.
                        Paragraph.StructuralCache.CurrentArrangeContext.PushNewPageData(_pageContextOfThisPage, arrayColumnDesc[index].fsrc,
                                                                                        Paragraph.StructuralCache.CurrentArrangeContext.FinitePage);

                        PtsHelper.ArrangeTrack(PtsContext, ref arrayColumnDesc[index], subpageDetails.u.complex.fswdir);

                        Paragraph.StructuralCache.CurrentArrangeContext.PopPageData();
                    }
                }
            }
        }