Esempio n. 1
0
        private void _CombinePass()
        {
            if (_fixedSOMPage.SemanticBoxes.Count < 2)
            {
                //Nothing to do
                return;
            }

            int prevBoxCount;

            do
            {
                prevBoxCount = _fixedSOMPage.SemanticBoxes.Count;

                List <FixedSOMSemanticBox> boxes = _fixedSOMPage.SemanticBoxes;
                for (int i = 0; i < boxes.Count; i++)
                {
                    FixedSOMTable table1 = boxes[i] as FixedSOMTable;
                    if (table1 != null)
                    {
                        //Check for nested tables
                        for (int j = i + 1; j < boxes.Count; j++)
                        {
                            FixedSOMTable table2 = boxes[j] as FixedSOMTable;
                            if (table2 != null &&
                                table1.AddContainer(table2))
                            {
                                boxes.Remove(table2);
                            }
                        }
                        continue;
                    }


                    FixedSOMFixedBlock box1 = boxes[i] as FixedSOMFixedBlock;
                    if (box1 == null || box1.IsFloatingImage)
                    {
                        continue;
                    }

                    for (int j = i + 1; j < boxes.Count; j++)
                    {
                        FixedSOMFixedBlock box2 = boxes[j] as FixedSOMFixedBlock;
                        if (box2 != null && !box2.IsFloatingImage &&
                            box2.Matrix.Equals(box1.Matrix) &&
                            (_IsSpatiallyCombinable(box1, box2, 0, 0)))
                        {
                            {
                                box1.CombineWith(box2);
                                boxes.Remove(box2);
                            }
                        }
                    }
                }
            } while (_fixedSOMPage.SemanticBoxes.Count > 1 && _fixedSOMPage.SemanticBoxes.Count != prevBoxCount);
        }
Esempio n. 2
0
 // Token: 0x06002E2C RID: 11820 RVA: 0x000D0B2C File Offset: 0x000CED2C
 private bool _AddToInnerTable(FixedSOMContainer container)
 {
     foreach (FixedSOMSemanticBox fixedSOMSemanticBox in this._semanticBoxes)
     {
         FixedSOMTable fixedSOMTable = fixedSOMSemanticBox as FixedSOMTable;
         if (fixedSOMTable != null && fixedSOMTable.AddContainer(container))
         {
             return(true);
         }
     }
     return(false);
 }
Esempio n. 3
0
        // Token: 0x06002E01 RID: 11777 RVA: 0x000CF564 File Offset: 0x000CD764
        private void _CombinePass()
        {
            if (this._fixedSOMPage.SemanticBoxes.Count < 2)
            {
                return;
            }
            int count;

            do
            {
                count = this._fixedSOMPage.SemanticBoxes.Count;
                List <FixedSOMSemanticBox> semanticBoxes = this._fixedSOMPage.SemanticBoxes;
                for (int i = 0; i < semanticBoxes.Count; i++)
                {
                    FixedSOMTable fixedSOMTable = semanticBoxes[i] as FixedSOMTable;
                    if (fixedSOMTable != null)
                    {
                        for (int j = i + 1; j < semanticBoxes.Count; j++)
                        {
                            FixedSOMTable fixedSOMTable2 = semanticBoxes[j] as FixedSOMTable;
                            if (fixedSOMTable2 != null && fixedSOMTable.AddContainer(fixedSOMTable2))
                            {
                                semanticBoxes.Remove(fixedSOMTable2);
                            }
                        }
                    }
                    else
                    {
                        FixedSOMFixedBlock fixedSOMFixedBlock = semanticBoxes[i] as FixedSOMFixedBlock;
                        if (fixedSOMFixedBlock != null && !fixedSOMFixedBlock.IsFloatingImage)
                        {
                            for (int k = i + 1; k < semanticBoxes.Count; k++)
                            {
                                FixedSOMFixedBlock fixedSOMFixedBlock2 = semanticBoxes[k] as FixedSOMFixedBlock;
                                if (fixedSOMFixedBlock2 != null && !fixedSOMFixedBlock2.IsFloatingImage && fixedSOMFixedBlock2.Matrix.Equals(fixedSOMFixedBlock.Matrix) && this._IsSpatiallyCombinable(fixedSOMFixedBlock, fixedSOMFixedBlock2, 0.0, 0.0))
                                {
                                    fixedSOMFixedBlock.CombineWith(fixedSOMFixedBlock2);
                                    semanticBoxes.Remove(fixedSOMFixedBlock2);
                                }
                            }
                        }
                    }
                }
            }while (this._fixedSOMPage.SemanticBoxes.Count > 1 && this._fixedSOMPage.SemanticBoxes.Count != count);
        }