コード例 #1
0
        // Token: 0x0600015B RID: 347 RVA: 0x00007B74 File Offset: 0x00006B74
        private void AddCells(Record record)
        {
            Bytes  data = record.Data;
            ushort num  = data.Get(0, 2).GetBits().ToUInt16();
            ushort num2 = data.Get(2, 2).GetBits().ToUInt16();
            ushort num3 = num2;
            ushort num4 = 4;

            byte[] array = record.RID;
            bool   flag  = false;

            if (array == RID.MULBLANK)
            {
                flag  = true;
                array = RID.BLANK;
            }
            else if (array == RID.MULRK)
            {
                flag  = true;
                array = RID.RK;
            }
            if (flag)
            {
                num3 = data.Get(data.Length - 2, 2).GetBits().ToUInt16();
            }
            while (num2 <= num3)
            {
                Cell cell = this.Cells.Add((ushort)(num + 1), (ushort)(num2 + 1));
                data.Get((int)num4, 2).GetBits().ToUInt16();
                num4 += 2;
                if (array == RID.BLANK)
                {
                    Bytes data2 = new Bytes();
                }
                else if (array == RID.RK)
                {
                    Bytes data2 = data.Get((int)num4, 4);
                    num4 += 4;
                    cell.SetValue(array, data2);
                }
                else
                {
                    Bytes data2 = data.Get((int)num4, data.Length - (int)num4);
                    if (array == RID.FORMULA)
                    {
                        FormulaRecord formulaRecord = record as FormulaRecord;
                        cell.SetFormula(data2, formulaRecord.StringRecord);
                    }
                    else
                    {
                        cell.SetValue(array, data2);
                    }
                }
                num2 += 1;
            }
        }
コード例 #2
0
        private void AddCells(Record record)
        {
            Bytes  bytes        = record.Data;
            ushort rowIndex     = bytes.Get(0, 2).GetBits().ToUInt16();
            ushort colIndex     = bytes.Get(2, 2).GetBits().ToUInt16();
            ushort lastColIndex = colIndex;
            ushort offset       = 4;

            byte[] rid     = record.RID;
            bool   isMulti = false;

            if (rid == RID.MULBLANK)
            {
                isMulti = true;
                rid     = RID.BLANK;
            }
            else if (rid == RID.MULRK)
            {
                isMulti = true;
                rid     = RID.RK;
            }

            if (isMulti)
            {
                lastColIndex = bytes.Get(bytes.Length - 2, 2).GetBits().ToUInt16();
            }


            while (colIndex <= lastColIndex)
            {
                Cell   cell    = Cells.Add((ushort)(rowIndex + 1), (ushort)(colIndex + 1));
                ushort xfIndex = bytes.Get(offset, 2).GetBits().ToUInt16();
                offset += 2;

                Bytes data;
                if (rid == RID.BLANK)
                {
                    data = new Bytes();
                }
                else if (rid == RID.RK)
                {
                    data    = bytes.Get(offset, 4);
                    offset += 4;
                    cell.SetValue(rid, data);
                }
                else
                {
                    data = bytes.Get(offset, bytes.Length - offset);
                    if (rid == RID.FORMULA)
                    {
                        FormulaRecord formulaRecord = record as FormulaRecord;
                        cell.SetFormula(data, formulaRecord.StringRecord);
                    }
                    else
                    {
                        cell.SetValue(rid, data);
                    }
                }
                colIndex++;
            }
        }