예제 #1
0
        public override Object Clone()
        {
            SCLRecord rec = new SCLRecord();

            rec.field_1_numerator   = field_1_numerator;
            rec.field_2_denominator = field_2_denominator;
            return(rec);
        }
예제 #2
0
        public void TestLoad()
        {
            SCLRecord record = new SCLRecord(TestcaseRecordInputStream.Create((short)0xa0, data));
            Assert.AreEqual(3, record.Numerator);
            Assert.AreEqual(4, record.Denominator);


            Assert.AreEqual(8, record.RecordSize);
        }
예제 #3
0
        public void TestStore()
        {
            SCLRecord record = new SCLRecord();
            record.Numerator = ((short)3);
            record.Denominator = ((short)4);


            byte[] recordBytes = record.Serialize();
            Assert.AreEqual(recordBytes.Length - 4, data.Length);
            for (int i = 0; i < data.Length; i++)
                Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
        }
예제 #4
0
파일: HSSFChart.cs 프로젝트: 89sos98/npoi
 private SCLRecord CreateSCLRecord(short numerator, short denominator)
 {
     SCLRecord r = new SCLRecord();
     r.Denominator = (denominator);
     r.Numerator = (numerator);
     return r;
 }
예제 #5
0
        /// <summary>
        /// Sets the zoom magnication for the _sheet.  The zoom is expressed as a
        /// fraction.  For example to express a zoom of 75% use 3 for the numerator
        /// and 4 for the denominator.
        /// </summary>
        /// <param name="numerator">The numerator for the zoom magnification.</param>
        /// <param name="denominator">The denominator for the zoom magnification.</param>
        public void SetZoom(int numerator, int denominator)
        {
            if (numerator < 1 || numerator > 65535)
                throw new ArgumentException("Numerator must be greater than 0 and less than 65536");
            if (denominator < 1 || denominator > 65535)
                throw new ArgumentException("Denominator must be greater than 0 and less than 65536");

            SCLRecord sclRecord = new SCLRecord();
            sclRecord.Numerator = ((short)numerator);
            sclRecord.Denominator = ((short)denominator);
            Sheet.SetSCLRecord(sclRecord);
        }
예제 #6
0
        public override Object Clone()
        {
            SCLRecord rec = new SCLRecord();

            rec.field_1_numerator = field_1_numerator;
            rec.field_2_denominator = field_2_denominator;
            return rec;
        }
예제 #7
0
파일: InternalSheet.cs 프로젝트: WPG/npoi
        /// <summary>
        /// Sets the SCL record or Creates it in the correct place if it does not
        /// already exist.
        /// </summary>
        /// <param name="sclRecord">The record to set.</param>
        public void SetSCLRecord(SCLRecord sclRecord)
        {
            int oldRecordLoc = FindFirstRecordLocBySid(SCLRecord.sid);
            if (oldRecordLoc == -1)
            {
                // Insert it after the window record
                int windowRecordLoc = FindFirstRecordLocBySid(WindowTwoRecord.sid);
                records.Insert(windowRecordLoc + 1, sclRecord);
            }
            else
            {
                records[oldRecordLoc] = sclRecord;
            }

        }