From ed4119e73cb07200c48af8bb34d0ebbd393bc0ba Mon Sep 17 00:00:00 2001 From: Shawn Laubach Date: Thu, 23 Oct 2003 17:16:03 +0000 Subject: [PATCH] Update to Quick Guide to better represent what the Fit To example is for. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/branches/REL_2_BRANCH@353407 13f79535-47bb-0310-9956-ffa450edef68 --- .../content/xdocs/hssf/quick-guide.xml | 10 +++++----- .../poi/hssf/usermodel/TestSheetShiftRows.java | 13 +++++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/documentation/content/xdocs/hssf/quick-guide.xml b/src/documentation/content/xdocs/hssf/quick-guide.xml index b5203d2058..39a1753385 100644 --- a/src/documentation/content/xdocs/hssf/quick-guide.xml +++ b/src/documentation/content/xdocs/hssf/quick-guide.xml @@ -31,7 +31,7 @@
  • Reading and writing
  • Use newlines in cells.
  • Create user defined data formats.
  • -
  • Fit sheet to one page
  • +
  • Fit Sheet to One Page
  • Set print area for a sheet.
  • Set page numbers on the footer of a sheet.
  • Shift rows.
  • @@ -420,14 +420,14 @@ fileOut.close(); - -
    Set Print Area to One Page + +
    Fit Sheet to One Page HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet("format sheet"); - HSSFPrintSetup ps = sheet.getPrintSetup() + HSSFPrintSetup ps = sheet.getPrintSetup(); - sheet.setAutobreaks(true) + sheet.setAutobreaks(true); ps.setFitHeight((short)1); ps.setFitWidth((short)1); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestSheetShiftRows.java b/src/testcases/org/apache/poi/hssf/usermodel/TestSheetShiftRows.java index a48fb683fc..e91003e4da 100755 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestSheetShiftRows.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestSheetShiftRows.java @@ -175,5 +175,18 @@ public class TestSheetShiftRows extends TestCase { s.createRow(3).createCell((short)0).setCellValue("TEST2"); s.shiftRows(0,4,1); } + + /** + * Tests when shifting the first row. + * + * @author Toshiaki Kamoshida (kamoshida.toshiaki at future dot co dot jp) + */ + public void testShiftRow0(){ + HSSFWorkbook b = new HSSFWorkbook(); + HSSFSheet s = b.createSheet(); + s.createRow(0).createCell((short)0).setCellValue("TEST1"); + s.createRow(3).createCell((short)0).setCellValue("TEST2"); + s.shiftRows(0,4,1); + } }