示例#1
0
        public void TestCorrectOrderInOptRecord()
        {
            HSSFWorkbook  wb        = new HSSFWorkbook();
            HSSFSheet     sheet     = wb.CreateSheet() as HSSFSheet;
            HSSFPatriarch patriarch = sheet.CreateDrawingPatriarch() as HSSFPatriarch;

            HSSFTextbox     textbox = patriarch.CreateTextbox(new HSSFClientAnchor()) as HSSFTextbox;
            EscherOptRecord opt     = HSSFTestHelper.GetOptRecord(textbox);

            String opt1Str = opt.ToXml();

            textbox.FillColor = textbox.FillColor;
            EscherContainerRecord Container = HSSFTestHelper.GetEscherContainer(textbox);
            EscherOptRecord       optRecord = Container.GetChildById(EscherOptRecord.RECORD_ID) as EscherOptRecord;

            Assert.AreEqual(opt1Str, optRecord.ToXml());
            textbox.LineStyle = textbox.LineStyle;
            Assert.AreEqual(opt1Str, optRecord.ToXml());
            textbox.LineWidth = textbox.LineWidth;
            Assert.AreEqual(opt1Str, optRecord.ToXml());
            textbox.LineStyleColor = textbox.LineStyleColor;
            Assert.AreEqual(opt1Str, optRecord.ToXml());

            wb.Close();
        }
示例#2
0
        public void TestOpt()
        {
            HSSFWorkbook wb = new HSSFWorkbook();

            // create a sheet with a text box
            HSSFSheet     sheet     = wb.CreateSheet() as HSSFSheet;
            HSSFPatriarch patriarch = sheet.CreateDrawingPatriarch() as HSSFPatriarch;

            HSSFTextbox     textbox = patriarch.CreateTextbox(new HSSFClientAnchor()) as HSSFTextbox;
            EscherOptRecord opt1    = HSSFTestHelper.GetOptRecord(textbox);
            EscherOptRecord opt2    = HSSFTestHelper.GetEscherContainer(textbox).GetChildById(EscherOptRecord.RECORD_ID) as EscherOptRecord;

            Assert.AreSame(opt1, opt2);
        }