Ejemplo n.º 1
0
  public void testBug45312() throws Exception {
    HSSFWorkbook wb = new HSSFWorkbook();
    try {
      HSSFSheet sheet = wb.createSheet();
      HSSFPatriarch patriarch = sheet.createDrawingPatriarch();

      {
        HSSFClientAnchor a1 = new HSSFClientAnchor();
        a1.setAnchor((short) 1, 1, 0, 0, (short) 1, 1, 512, 100);
        HSSFSimpleShape shape1 = patriarch.createSimpleShape(a1);
        shape1.setShapeType(HSSFSimpleShape.OBJECT_TYPE_LINE);
      }
      {
        HSSFClientAnchor a1 = new HSSFClientAnchor();
        a1.setAnchor((short) 1, 1, 512, 0, (short) 1, 1, 1024, 100);
        HSSFSimpleShape shape1 = patriarch.createSimpleShape(a1);
        shape1.setFlipVertical(true);
        shape1.setShapeType(HSSFSimpleShape.OBJECT_TYPE_LINE);
      }

      {
        HSSFClientAnchor a1 = new HSSFClientAnchor();
        a1.setAnchor((short) 2, 2, 0, 0, (short) 2, 2, 512, 100);
        HSSFSimpleShape shape1 = patriarch.createSimpleShape(a1);
        shape1.setShapeType(HSSFSimpleShape.OBJECT_TYPE_LINE);
      }
      {
        HSSFClientAnchor a1 = new HSSFClientAnchor();
        a1.setAnchor((short) 2, 2, 0, 100, (short) 2, 2, 512, 200);
        HSSFSimpleShape shape1 = patriarch.createSimpleShape(a1);
        shape1.setFlipHorizontal(true);
        shape1.setShapeType(HSSFSimpleShape.OBJECT_TYPE_LINE);
      }

      /*OutputStream stream = new FileOutputStream("/tmp/45312.xls");
      try {
          wb.write(stream);
      } finally {
          stream.close();
      }*/

      checkWorkbookBack(wb);
    } finally {
      wb.close();
    }
  }