poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject cvs commit: jakarta-poi/src/testcases/org/apache/poi/hssf/usermodel TestHSSFSheet.java
Date Wed, 01 Jan 2003 09:24:39 GMT
avik        2003/01/01 01:24:39

  Modified:    .        .classpath .project
               src/java/org/apache/poi/hssf/usermodel HSSFSheet.java
               src/testcases/org/apache/poi/hssf/usermodel
                        TestHSSFSheet.java
  Log:
  PR:15677
  
  Revision  Changes    Path
  1.3       +2 -2      jakarta-poi/.classpath
  
  Index: .classpath
  ===================================================================
  RCS file: /home/cvs/jakarta-poi/.classpath,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- .classpath	23 Nov 2002 19:03:27 -0000	1.2
  +++ .classpath	1 Jan 2003 09:24:39 -0000	1.3
  @@ -3,8 +3,8 @@
       <classpathentry kind="src" path="src/testcases"/>
       <classpathentry kind="src" path="src/java"/>
       <classpathentry kind="src" path="src/examples/src"/>
  -    <classpathentry kind="src" path="src/documentation/xdocs"/>
       <classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT" sourcepath="JRE_SRC"/>
  -    <classpathentry exported="true" kind="lib" path="D:/cygwin/opt/eclipse/workspace/jakarta-poi/tools/cents/junit.cent/lib/junit-3.7.jar"/>
  +    <classpathentry kind="lib" path="tools/cents/junit.cent/lib/junit-3.7.jar"/>
  +    <classpathentry kind="lib" path="lib/core/commons-logging-1.0.jar"/>
       <classpathentry kind="output" path="build"/>
   </classpath>
  
  
  
  1.2       +1 -1      jakarta-poi/.project
  
  Index: .project
  ===================================================================
  RCS file: /home/cvs/jakarta-poi/.project,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- .project	11 Nov 2002 01:34:00 -0000	1.1
  +++ .project	1 Jan 2003 09:24:39 -0000	1.2
  @@ -1,6 +1,6 @@
   <?xml version="1.0" encoding="UTF-8"?>
   <projectDescription>
  -	<name>jakarta-poi</name>
  +	<name>POI</name>
   	<comment></comment>
   	<projects>
   	</projects>
  
  
  
  1.17      +27 -0     jakarta-poi/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java
  
  Index: HSSFSheet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-poi/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- HSSFSheet.java	26 Dec 2002 22:55:26 -0000	1.16
  +++ HSSFSheet.java	1 Jan 2003 09:24:39 -0000	1.17
  @@ -514,6 +514,33 @@
       }
   
       /**
  +     * determines whether the output is horizontally centered on the page.
  +     * @param value true to horizontally center, false otherwise.
  +     */
  +
  +    public void setHorizontallyCenter(boolean value)
  +    {
  +        HCenterRecord record =
  +                (HCenterRecord) sheet.findFirstRecordBySid(HCenterRecord.sid);
  +
  +        record.setHCenter(value);
  +    }
  +
  +    /**
  +     * Determine whether printed output for this sheet will be horizontally centered.
  +     */
  +
  +    public boolean getHorizontallyCenter()
  +    {
  +        HCenterRecord record =
  +                (HCenterRecord) sheet.findFirstRecordBySid(HCenterRecord.sid);
  +
  +        return record.getHCenter();
  +    }
  +    
  +    
  +    
  +    /**
        * removes a merged region of cells (hence letting them free)
        * @param index of the region to unmerge
        */
  
  
  
  1.9       +21 -0     jakarta-poi/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java
  
  Index: TestHSSFSheet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-poi/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- TestHSSFSheet.java	26 Dec 2002 23:14:09 -0000	1.8
  +++ TestHSSFSheet.java	1 Jan 2003 09:24:39 -0000	1.9
  @@ -56,6 +56,7 @@
   
   import junit.framework.TestCase;
   import org.apache.poi.hssf.model.Sheet;
  +import org.apache.poi.hssf.record.HCenterRecord;
   import org.apache.poi.hssf.record.VCenterRecord;
   import org.apache.poi.hssf.record.WSBoolRecord;
   
  @@ -115,6 +116,26 @@
           // wb.write(new FileOutputStream("c:\\test.xls"));
       }
   
  +    /**
  +     * Test horizontally centered output.
  +     */
  +
  +    public void testHorizontallyCenter()
  +            throws Exception
  +    {
  +        HSSFWorkbook wb = new HSSFWorkbook();
  +        HSSFSheet s = wb.createSheet();
  +        Sheet sheet = s.getSheet();
  +        HCenterRecord record =
  +                (HCenterRecord) sheet.findFirstRecordBySid(HCenterRecord.sid);
  +
  +        assertEquals(false, record.getHCenter());
  +        s.setHorizontallyCenter(true);
  +        assertEquals(true, record.getHCenter());
  +
  +    }    
  +    
  +    
       /**
        * Test WSBboolRecord fields get set in the user model.
        */
  
  
  

Mime
View raw message