diff options
author | Avik Sengupta <avik@apache.org> | 2003-01-01 09:24:39 +0000 |
---|---|---|
committer | Avik Sengupta <avik@apache.org> | 2003-01-01 09:24:39 +0000 |
commit | 6d48d8b0baf934acd4344d5c62df4a3d989f57d3 (patch) | |
tree | 67bd757681f4ea671d4ebe13c4cba3f3b0d2372a | |
parent | b9cf50ef60d9cdf0115d84e16afcee41b14d923d (diff) | |
download | poi-6d48d8b0baf934acd4344d5c62df4a3d989f57d3.tar.gz poi-6d48d8b0baf934acd4344d5c62df4a3d989f57d3.zip |
PR:15677
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352975 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | .classpath | 4 | ||||
-rw-r--r-- | .project | 2 | ||||
-rw-r--r-- | src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java | 27 | ||||
-rw-r--r-- | src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java | 21 |
4 files changed, 51 insertions, 3 deletions
diff --git a/.classpath b/.classpath index 434b9d83e1..75589e24b1 100644 --- a/.classpath +++ b/.classpath @@ -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,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <projectDescription> - <name>jakarta-poi</name> + <name>POI</name> <comment></comment> <projects> </projects> diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java b/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java index 94e2f31323..17b24aadb1 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java @@ -514,6 +514,33 @@ public class HSSFSheet } /** + * 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 */ diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java index 9b57ac8709..27aa0e24fa 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java @@ -56,6 +56,7 @@ package org.apache.poi.hssf.usermodel; 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; @@ -116,6 +117,26 @@ public class TestHSSFSheet } /** + * 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. */ |