예제 #1
0
        // Token: 0x060001EA RID: 490 RVA: 0x000096B8 File Offset: 0x000086B8
        private void ReadXF_3(Bytes bytes)
        {
            Bytes.Bits bits = bytes.GetBits();
            ushort     num  = bits.Get(4, 12).ToUInt16();

            if (num != 4095)
            {
                this.ReadStyleXfIndex = new ushort?(num);
            }
            this.ReadXF_TYPE_PROT(bits.Get(4));
        }
예제 #2
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));
        }
예제 #3
0
        // Token: 0x06000158 RID: 344 RVA: 0x00007844 File Offset: 0x00006844
        private static object DecodeRKInt(Bytes.Bits bits, bool div100)
        {
            object obj = bits.Get(2, 30).ToInt32();

            if (div100)
            {
                obj = Convert.ToDouble(obj) / 100.0;
            }
            return(obj);
        }
예제 #4
0
파일: CellTests.cs 프로젝트: radtek/shi5588
        public void ChoppedDoubleIsValidDecimalRK()
        {
            double dbl   = 123.4567;
            Bytes  bytes = new Bytes(BitConverter.GetBytes(dbl));

            Bytes.Bits bits        = bytes.GetBits();
            Bytes.Bits mostSigBits = bits.Get(34, 30);
            double     newDbl      = mostSigBits.ToDouble();

            Assert.AreEqual(dbl, newDbl, 0.001, "Values are too different");
        }
예제 #5
0
파일: CellTests.cs 프로젝트: radtek/shi5588
        public void DoubleIsLittleEndian()
        {
            double dbl   = 123.4567;
            Bytes  bytes = new Bytes(BitConverter.GetBytes(dbl));

            Bytes.Bits bits        = bytes.GetBits();
            Bytes.Bits mostSigBits = bits.Get(2, 62);
            double     newDbl      = mostSigBits.ToDouble();

            Assert.AreEqual(dbl, newDbl, 0.000001, "Values are different");
        }
예제 #6
0
파일: Cell.cs 프로젝트: neao2002/RS.Core
        private static int DecodeRKInt(Bytes.Bits bits, bool div100)
        {
            int val = bits.Get(2, 30).ToInt32();

            if (div100)
            {
                val /= 10; //do it this way in case we get the same behavior as
                           //above when multiplying by 100
                val /= 10;
            }
            return(val);
        }
예제 #7
0
        // Token: 0x06000157 RID: 343 RVA: 0x000077DC File Offset: 0x000067DC
        private static double DecodeRKFloat(Bytes.Bits bits, bool div100)
        {
            Bytes.Bits bits2 = bits.Get(2, 30);
            bits2.Prepend(false);
            bits2.Prepend(false);
            byte[] array = new byte[8];
            bits2.GetBytes().ByteArray.CopyTo(array, 4);
            BitConverter.GetBytes(1.0);
            double num = BitConverter.ToDouble(array, 0);

            if (div100)
            {
                num /= 100.0;
            }
            return(num);
        }
예제 #8
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);
        }
예제 #9
0
파일: Cell.cs 프로젝트: neao2002/RS.Core
        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 /= 10.0; //do it this way in case we get the same behavior as
                             //above when multiplying by 100
                val /= 10.0;
            }
            return(val);
        }