// Token: 0x06006A24 RID: 27172 RVA: 0x001E3960 File Offset: 0x001E1B60
        internal void CalculateRowSpans()
        {
            RowParagraph previousRow = null;

            if (this.Row.Index != 0 && this.Previous != null)
            {
                previousRow = (RowParagraph)this.Previous;
            }
            Invariant.Assert(this._cellParagraphs == null);
            this._cellParagraphs = new CellParagraph[this.Row.Cells.Count];
            for (int i = 0; i < this.Row.Cells.Count; i++)
            {
                this._cellParagraphs[i] = new CellParagraph(this.Row.Cells[i], base.StructuralCache);
            }
            Invariant.Assert(this._spannedCells == null);
            if (this.Row.SpannedCells != null)
            {
                this._spannedCells = new CellParagraph[this.Row.SpannedCells.Length];
            }
            else
            {
                this._spannedCells = new CellParagraph[0];
            }
            for (int j = 0; j < this._spannedCells.Length; j++)
            {
                this._spannedCells[j] = this.FindCellParagraphForCell(previousRow, this.Row.SpannedCells[j]);
            }
        }
Пример #2
0
 // ------------------------------------------------------------------
 // Invalidate accumulated format caches for the row.
 // ------------------------------------------------------------------
 private void InvalidateRowFormatCache(RowParagraph rowParagraph)
 {
     for (int iCell = 0; iCell < rowParagraph.Cells.Length; iCell++)
     {
         rowParagraph.Cells[iCell].InvalidateFormatCache();
     }
 }
 // Token: 0x06006AD8 RID: 27352 RVA: 0x001E9440 File Offset: 0x001E7640
 internal override void InvalidateFormatCache()
 {
     for (RowParagraph rowParagraph = this._firstChild as RowParagraph; rowParagraph != null; rowParagraph = (rowParagraph.Next as RowParagraph))
     {
         this.InvalidateRowFormatCache(rowParagraph);
     }
 }
Пример #4
0
        /// <summary>
        /// Calculates the spanned cells for this paragraph from the spanned cells for the previous paragraph.
        /// This needs to be done to share the spanned cell paragraphs.
        /// </summary>
        internal void CalculateRowSpans()
        {
            RowParagraph rowPrevious = null;

            if (Row.Index != 0 && Previous != null)
            {
                rowPrevious = ((RowParagraph)Previous);
            }

            Invariant.Assert(_cellParagraphs == null);

            _cellParagraphs = new CellParagraph[Row.Cells.Count];

            for (int cellIndex = 0; cellIndex < Row.Cells.Count; cellIndex++)
            {
                _cellParagraphs[cellIndex] = new CellParagraph(Row.Cells[cellIndex], StructuralCache);
            }

            Invariant.Assert(_spannedCells == null);

            if (Row.SpannedCells != null)
            {
                _spannedCells = new CellParagraph[Row.SpannedCells.Length];
            }
            else
            {
                _spannedCells = new CellParagraph[0];
            }

            for (int index = 0; index < _spannedCells.Length; index++)
            {
                _spannedCells[index] = FindCellParagraphForCell(rowPrevious, Row.SpannedCells[index]);
            }
        }
Пример #5
0
        // ------------------------------------------------------------------
        // Invalidate accumulated format caches for the table.
        // ------------------------------------------------------------------
        internal override void InvalidateFormatCache()
        {
            RowParagraph currentParagraph = _firstChild as RowParagraph;

            while (currentParagraph != null)
            {
                InvalidateRowFormatCache(currentParagraph);

                currentParagraph = currentParagraph.Next as RowParagraph;
            }
        }
        // Token: 0x06006AD7 RID: 27351 RVA: 0x001E9404 File Offset: 0x001E7604
        internal override bool InvalidateStructure(int startPosition)
        {
            bool result = true;

            for (RowParagraph rowParagraph = this._firstChild as RowParagraph; rowParagraph != null; rowParagraph = (rowParagraph.Next as RowParagraph))
            {
                if (!this.InvalidateRowStructure(rowParagraph, startPosition))
                {
                    result = false;
                }
            }
            return(result);
        }
        // Token: 0x06006ADA RID: 27354 RVA: 0x001E9480 File Offset: 0x001E7680
        private bool InvalidateRowStructure(RowParagraph rowParagraph, int startPosition)
        {
            bool result = true;

            for (int i = 0; i < rowParagraph.Cells.Length; i++)
            {
                CellParagraph cellParagraph = rowParagraph.Cells[i];
                if (cellParagraph.ParagraphEndCharacterPosition < startPosition || !cellParagraph.InvalidateStructure(startPosition))
                {
                    result = false;
                }
            }
            return(result);
        }
Пример #8
0
        //------------------------------------------------------
        //
        //  Private methods
        //
        //------------------------------------------------------
        #region Private Methods

        // ------------------------------------------------------------------
        // Invalidate accumulated format caches for the row.
        // ------------------------------------------------------------------
        private bool InvalidateRowStructure(RowParagraph rowParagraph, int startPosition)
        {
            bool isEntireTableInvalid = true;

            for (int iCell = 0; iCell < rowParagraph.Cells.Length; iCell++)
            {
                CellParagraph cellParagraph = rowParagraph.Cells[iCell];

                if (cellParagraph.ParagraphEndCharacterPosition < startPosition ||
                    !cellParagraph.InvalidateStructure(startPosition))
                {
                    isEntireTableInvalid = false;
                }
            }
            return(isEntireTableInvalid);
        }
Пример #9
0
        // ------------------------------------------------------------------
        // Invalidate content's structural cache.
        //
        //      startPosition - Position to start invalidation from.
        //
        // Returns: 'true' if entire paragraph is invalid.
        // ------------------------------------------------------------------
        internal override bool InvalidateStructure(int startPosition)
        {
            bool         isEntireTableInvalid = true;
            RowParagraph currentParagraph     = _firstChild as RowParagraph;

            while (currentParagraph != null)
            {
                if (!InvalidateRowStructure(currentParagraph, startPosition))
                {
                    isEntireTableInvalid = false;
                }

                currentParagraph = currentParagraph.Next as RowParagraph;
            }

            return(isEntireTableInvalid);
        }
        // Token: 0x06006AD2 RID: 27346 RVA: 0x001E92E0 File Offset: 0x001E74E0
        internal void GetNextRow(IntPtr nmRow, out int fFound, out IntPtr pnmNextRow)
        {
            BaseParagraph baseParagraph  = (RowParagraph)base.PtsContext.HandleToObject(nmRow);
            BaseParagraph baseParagraph2 = baseParagraph.Next;

            if (baseParagraph2 == null)
            {
                TableRow      row      = ((RowParagraph)baseParagraph).Row;
                TableRowGroup rowGroup = row.RowGroup;
                TableRow      tableRow = null;
                int           num      = row.Index + 1;
                int           num2     = rowGroup.Index + 1;
                if (num < rowGroup.Rows.Count)
                {
                    tableRow = rowGroup.Rows[num];
                }
                while (tableRow == null && num2 != this.Table.RowGroups.Count)
                {
                    TableRowCollection rows = this.Table.RowGroups[num2].Rows;
                    if (rows.Count > 0)
                    {
                        tableRow = rows[0];
                    }
                    num2++;
                }
                if (tableRow != null)
                {
                    baseParagraph2          = new RowParagraph(tableRow, base.StructuralCache);
                    baseParagraph.Next      = baseParagraph2;
                    baseParagraph2.Previous = baseParagraph;
                    ((RowParagraph)baseParagraph2).CalculateRowSpans();
                }
            }
            if (baseParagraph2 != null)
            {
                fFound     = 1;
                pnmNextRow = baseParagraph2.Handle;
                return;
            }
            fFound     = 0;
            pnmNextRow = IntPtr.Zero;
        }
 // Token: 0x06006A29 RID: 27177 RVA: 0x001E3AFC File Offset: 0x001E1CFC
 private CellParagraph FindCellParagraphForCell(RowParagraph previousRow, TableCell cell)
 {
     for (int i = 0; i < this._cellParagraphs.Length; i++)
     {
         if (this._cellParagraphs[i].Cell == cell)
         {
             return(this._cellParagraphs[i]);
         }
     }
     if (previousRow != null)
     {
         for (int j = 0; j < previousRow._spannedCells.Length; j++)
         {
             if (previousRow._spannedCells[j].Cell == cell)
             {
                 return(previousRow._spannedCells[j]);
             }
         }
     }
     Invariant.Assert(false, "Structural integrity for table not correct.");
     return(null);
 }
Пример #12
0
        /// <summary>
        /// GetFirstRow
        /// </summary>
        /// <param name="fFound">Indication that first body row is found</param>
        /// <param name="pnmFirstRow">First body row name</param>
        internal void GetFirstRow(
            out int fFound,
            out IntPtr pnmFirstRow)
        {
            if (_firstChild == null)
            {
                TableRow tableRow = null;
                for (int rowGroupIndex = 0; rowGroupIndex < Table.RowGroups.Count && tableRow == null; rowGroupIndex++)
                {
                    TableRowGroup rowGroup = Table.RowGroups[rowGroupIndex];
                    if (rowGroup.Rows.Count > 0)
                    {
                        tableRow = rowGroup.Rows[0];
                        Invariant.Assert(tableRow.Index != -1);
                    }
                }

                if (tableRow != null)
                {
                    _firstChild = new RowParagraph(tableRow, StructuralCache);

                    ((RowParagraph)_firstChild).CalculateRowSpans();
                }
            }

            if (_firstChild != null)
            {
                fFound      = PTS.True;
                pnmFirstRow = _firstChild.Handle;
            }
            else
            {
                fFound      = PTS.False;
                pnmFirstRow = IntPtr.Zero;
            }
        }
Пример #13
0
        //------------------------------------------------------
        //
        //  Private Methods
        //
        //------------------------------------------------------

        #region Private Methods

        /// <summary>
        /// Helper method to scan our cell list for a cell paragraph, and if not found, look at the spanning cell paragraphs
        /// from previous row, if one exists.
        /// </summary>
        private CellParagraph FindCellParagraphForCell(RowParagraph previousRow, TableCell cell)
        {
            for (int index = 0; index < _cellParagraphs.Length; index++)
            {
                if (_cellParagraphs[index].Cell == cell)
                {
                    return(_cellParagraphs[index]);
                }
            }

            if (previousRow != null)
            {
                for (int index = 0; index < previousRow._spannedCells.Length; index++)
                {
                    if (previousRow._spannedCells[index].Cell == cell)
                    {
                        return(previousRow._spannedCells[index]);
                    }
                }
            }

            Invariant.Assert(false, "Structural integrity for table not correct.");
            return(null);
        }
Пример #14
0
        //-------------------------------------------------------------------
        //
        //  Constructors
        //
        //-------------------------------------------------------------------

        #region Constructors

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="paraClient">Object representing a paragraph.</param>
        /// <param name="index">Index of row in paragraph.</param>
        /// <param name="rowRect">Rectangle of row - as rendered.</param>
        /// <param name="rowParagraph">Actual paragraph result is bound to.</param>
        internal RowParagraphResult(BaseParaClient paraClient, int index, Rect rowRect, RowParagraph rowParagraph)
            : base(paraClient, rowRect, rowParagraph.Element)
        {
            _index = index;
        }
Пример #15
0
        /// <summary>
        /// GetFirstRow
        /// </summary>
        /// <param name="fFound">Indication that first body row is found</param>
        /// <param name="pnmFirstRow">First body row name</param>
        internal void GetFirstRow(
            out int fFound,
            out IntPtr pnmFirstRow)
        {            
            if(_firstChild == null)
            {
                TableRow tableRow = null;
                for(int rowGroupIndex = 0; rowGroupIndex < Table.RowGroups.Count && tableRow == null; rowGroupIndex++)
                {
                    TableRowGroup rowGroup = Table.RowGroups[rowGroupIndex];
                    if(rowGroup.Rows.Count > 0)
                    {
                        tableRow = rowGroup.Rows[0];
                        Invariant.Assert(tableRow.Index != -1);
                    }
                }

                if(tableRow != null)
                {
                    _firstChild = new RowParagraph(tableRow, StructuralCache);

                    ((RowParagraph)_firstChild).CalculateRowSpans();
                }
            }

            if(_firstChild != null)
            {
                fFound = PTS.True;
                pnmFirstRow = _firstChild.Handle;
            }
            else
            {
                fFound = PTS.False;
                pnmFirstRow = IntPtr.Zero;
            }
        }
Пример #16
0
        /// <summary>
        /// GetNextRow
        /// </summary>
        /// <param name="nmRow">Previous body row name</param>
        /// <param name="fFound">Indication that body row is found</param>
        /// <param name="pnmNextRow">Body row name</param>
        internal void GetNextRow(
            IntPtr nmRow,  
            out int fFound,
            out IntPtr pnmNextRow)
        {
            Debug.Assert(Table.RowGroups.Count > 0);

            BaseParagraph prevParagraph = ((RowParagraph)PtsContext.HandleToObject(nmRow));
            BaseParagraph nextParagraph = prevParagraph.Next;

            if(nextParagraph == null)
            {
                TableRow currentRow = ((RowParagraph)prevParagraph).Row;
                TableRowGroup currentRowGroup = currentRow.RowGroup;
                TableRow tableRow = null;

                int nextRowIndex = currentRow.Index + 1;
                int nextRowGroupIndex = currentRowGroup.Index + 1;

                if (nextRowIndex < currentRowGroup.Rows.Count)
                {
                    Debug.Assert(currentRowGroup.Rows[nextRowIndex].Index != -1, 
                        "Row is not in a table");

                    tableRow = currentRowGroup.Rows[nextRowIndex];
                }

                while(tableRow == null)
                {
                    if(nextRowGroupIndex == Table.RowGroups.Count)
                    {
                        break;
                    }

                    TableRowCollection Rows = Table.RowGroups[nextRowGroupIndex].Rows;

                    if (Rows.Count > 0)
                    {
                        Debug.Assert(Rows[0].Index != -1,
                            "Row is not in a table");

                        tableRow = Rows[0];
                    }

                    nextRowGroupIndex++;
                }

                if(tableRow != null)
                {
                    nextParagraph = new RowParagraph(tableRow, StructuralCache);
                    prevParagraph.Next = nextParagraph;
                    nextParagraph.Previous = prevParagraph;

                    ((RowParagraph)nextParagraph).CalculateRowSpans();
                }
            }

            if(nextParagraph != null)
            {
                fFound = PTS.True;
                pnmNextRow = nextParagraph.Handle;
            }
            else
            {
                fFound = PTS.False;
                pnmNextRow = IntPtr.Zero;
            }
        }
Пример #17
0
        //------------------------------------------------------
        //
        //  Private methods
        //
        //------------------------------------------------------
        #region Private Methods

        // ------------------------------------------------------------------
        // Invalidate accumulated format caches for the row.
        // ------------------------------------------------------------------
        private bool InvalidateRowStructure(RowParagraph rowParagraph, int startPosition)
        {
            bool isEntireTableInvalid = true;

            for(int iCell = 0; iCell < rowParagraph.Cells.Length; iCell++)
            {
                CellParagraph cellParagraph = rowParagraph.Cells[iCell];

                if(cellParagraph.ParagraphEndCharacterPosition < startPosition || 
                   !cellParagraph.InvalidateStructure(startPosition))
                {
                    isEntireTableInvalid = false;
                }
            }
            return isEntireTableInvalid;
        }
Пример #18
0
 // ------------------------------------------------------------------
 // Invalidate accumulated format caches for the row.
 // ------------------------------------------------------------------
 private void InvalidateRowFormatCache(RowParagraph rowParagraph)
 {
     for(int iCell = 0; iCell < rowParagraph.Cells.Length; iCell++)
     {
         rowParagraph.Cells[iCell].InvalidateFormatCache();
     }
 }
Пример #19
0
        //------------------------------------------------------
        //
        //  Private Methods
        //
        //------------------------------------------------------

        #region Private Methods

        /// <summary>
        /// Helper method to scan our cell list for a cell paragraph, and if not found, look at the spanning cell paragraphs
        /// from previous row, if one exists.
        /// </summary>
        private CellParagraph FindCellParagraphForCell(RowParagraph previousRow, TableCell cell)
        {
            for(int index = 0; index < _cellParagraphs.Length; index++)
            {
                if(_cellParagraphs[index].Cell == cell)
                {
                    return _cellParagraphs[index];
                }
            }

            if(previousRow != null)
            {
                for(int index = 0; index < previousRow._spannedCells.Length; index++)
                {
                    if(previousRow._spannedCells[index].Cell == cell)
                    {
                        return previousRow._spannedCells[index];
                    }
                }
            }

            Invariant.Assert(false, "Structural integrity for table not correct.");
            return null;
        }
Пример #20
0
        /// <summary>
        /// GetNextRow
        /// </summary>
        /// <param name="nmRow">Previous body row name</param>
        /// <param name="fFound">Indication that body row is found</param>
        /// <param name="pnmNextRow">Body row name</param>
        internal void GetNextRow(
            IntPtr nmRow,
            out int fFound,
            out IntPtr pnmNextRow)
        {
            Debug.Assert(Table.RowGroups.Count > 0);

            BaseParagraph prevParagraph = ((RowParagraph)PtsContext.HandleToObject(nmRow));
            BaseParagraph nextParagraph = prevParagraph.Next;

            if (nextParagraph == null)
            {
                TableRow      currentRow      = ((RowParagraph)prevParagraph).Row;
                TableRowGroup currentRowGroup = currentRow.RowGroup;
                TableRow      tableRow        = null;

                int nextRowIndex      = currentRow.Index + 1;
                int nextRowGroupIndex = currentRowGroup.Index + 1;

                if (nextRowIndex < currentRowGroup.Rows.Count)
                {
                    Debug.Assert(currentRowGroup.Rows[nextRowIndex].Index != -1,
                                 "Row is not in a table");

                    tableRow = currentRowGroup.Rows[nextRowIndex];
                }

                while (tableRow == null)
                {
                    if (nextRowGroupIndex == Table.RowGroups.Count)
                    {
                        break;
                    }

                    TableRowCollection Rows = Table.RowGroups[nextRowGroupIndex].Rows;

                    if (Rows.Count > 0)
                    {
                        Debug.Assert(Rows[0].Index != -1,
                                     "Row is not in a table");

                        tableRow = Rows[0];
                    }

                    nextRowGroupIndex++;
                }

                if (tableRow != null)
                {
                    nextParagraph          = new RowParagraph(tableRow, StructuralCache);
                    prevParagraph.Next     = nextParagraph;
                    nextParagraph.Previous = prevParagraph;

                    ((RowParagraph)nextParagraph).CalculateRowSpans();
                }
            }

            if (nextParagraph != null)
            {
                fFound     = PTS.True;
                pnmNextRow = nextParagraph.Handle;
            }
            else
            {
                fFound     = PTS.False;
                pnmNextRow = IntPtr.Zero;
            }
        }