示例#1
0
        private static object DecodeRKInt(Bytes.Bits bits, bool div100)
        {
            object val = bits.Get(2, 30).ToInt32();

            if (div100)
            {
                val = Convert.ToDouble(val) / 100.0;
            }
            return(val);
        }
示例#2
0
        private static double DecodeRKFloat(Bytes.Bits bits, bool div100)
        {
            Bytes.Bits floatBits = bits.Get(2, 30);
            floatBits.Prepend(false); //right-shift to full 8 bytes
            floatBits.Prepend(false);
            byte[] floatBytes = new byte[8];
            floatBits.GetBytes().ByteArray.CopyTo(floatBytes, 4);
            byte[] double1Bytes = BitConverter.GetBytes((double)1);
            double val          = BitConverter.ToDouble(floatBytes, 0);

            if (div100)
            {
                val /= 100.0;
            }
            return(val);
        }
示例#3
0
        private void DecodeRK(Bytes bytes)
        {
            Bytes.Bits bits   = bytes.GetBits();
            bool       div100 = bits.Values[0];
            bool       isInt  = bits.Values[1];

            if (isInt)
            {
                Value = DecodeRKInt(bits, div100);
                _type = (Value is Int32) ? CellTypes.Integer : CellTypes.Float;
            }
            else
            {
                Value = DecodeRKFloat(bits, div100);
                _type = CellTypes.Float;
            }
        }
示例#4
0
        private void ReadXF_3(Bytes bytes)
        {
            Bytes.Bits bits = bytes.GetBits();

            ushort parentStyleXfIndex = bits.Get(4, 12).ToUInt16();

            if (parentStyleXfIndex == 4095)
            {
                //this is a Style XF -- do nothing
            }
            else
            {
                ReadStyleXfIndex = parentStyleXfIndex; //we'll assign the style xf index later using the xfIdxLookups collected by Workbook.ReadBytes()
            }

            ReadXF_TYPE_PROT(bits.Get(4));
        }
示例#5
0
 private void ReadXF_TYPE_PROT(Bytes.Bits bits)
 {
 }