コード例 #1
0
ファイル: TestHSSFAnchor.cs プロジェクト: zuiwanting/npoi
        public void TestCreateClientAnchorFromContainer()
        {
            EscherContainerRecord    container = new EscherContainerRecord();
            EscherClientAnchorRecord escher    = new EscherClientAnchorRecord();

            escher.Flag = ((short)3);
            escher.Col1 = ((short)11);
            escher.Col2 = ((short)12);
            escher.Row1 = ((short)13);
            escher.Row2 = ((short)14);
            escher.Dx1  = ((short)15);
            escher.Dx2  = ((short)16);
            escher.Dy1  = ((short)17);
            escher.Dy2  = ((short)18);
            container.AddChildRecord(escher);

            HSSFClientAnchor anchor = (HSSFClientAnchor)HSSFAnchor.CreateAnchorFromEscher(container);

            Assert.AreEqual(anchor.Col1, 11);
            Assert.AreEqual(escher.Col1, 11);
            Assert.AreEqual(anchor.Col2, 12);
            Assert.AreEqual(escher.Col2, 12);
            Assert.AreEqual(anchor.Row1, 13);
            Assert.AreEqual(escher.Row1, 13);
            Assert.AreEqual(anchor.Row2, 14);
            Assert.AreEqual(escher.Row2, 14);
            Assert.AreEqual(anchor.Dx1, 15);
            Assert.AreEqual(escher.Dx1, 15);
            Assert.AreEqual(anchor.Dx2, 16);
            Assert.AreEqual(escher.Dx2, 16);
            Assert.AreEqual(anchor.Dy1, 17);
            Assert.AreEqual(escher.Dy1, 17);
            Assert.AreEqual(anchor.Dy2, 18);
            Assert.AreEqual(escher.Dy2, 18);
        }
コード例 #2
0
ファイル: TestHSSFAnchor.cs プロジェクト: zuiwanting/npoi
        public void TestCreateChildAnchorFromContainer()
        {
            EscherContainerRecord   container = new EscherContainerRecord();
            EscherChildAnchorRecord escher    = new EscherChildAnchorRecord();

            escher.Dx1 = ((short)15);
            escher.Dx2 = ((short)16);
            escher.Dy1 = ((short)17);
            escher.Dy2 = ((short)18);
            container.AddChildRecord(escher);

            HSSFChildAnchor anchor = (HSSFChildAnchor)HSSFAnchor.CreateAnchorFromEscher(container);

            Assert.AreEqual(anchor.Dx1, 15);
            Assert.AreEqual(escher.Dx1, 15);
            Assert.AreEqual(anchor.Dx2, 16);
            Assert.AreEqual(escher.Dx2, 16);
            Assert.AreEqual(anchor.Dy1, 17);
            Assert.AreEqual(escher.Dy1, 17);
            Assert.AreEqual(anchor.Dy2, 18);
            Assert.AreEqual(escher.Dy2, 18);
        }