]> source.dussan.org Git - poi.git/commitdiff
added a method to set arabic mode in HSSFSheet, see Bugzilla 47970
authorYegor Kozlov <yegor@apache.org>
Fri, 6 Nov 2009 19:40:07 +0000 (19:40 +0000)
committerYegor Kozlov <yegor@apache.org>
Fri, 6 Nov 2009 19:40:07 +0000 (19:40 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@833537 13f79535-47bb-0310-9956-ffa450edef68

src/documentation/content/xdocs/status.xml
src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java
src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java

index a5e5baafff4a3754ecf54af6752fa6e16bb5ab6f..7725c909d2c97eab5ae03848b8a217ccd63e92f2 100644 (file)
@@ -34,6 +34,7 @@
 
     <changes>
         <release version="3.6-beta1" date="2009-??-??">
+           <action dev="POI-DEVELOPERS" type="add">47970 - added a method to set arabic mode in HSSFSheet</action>
            <action dev="POI-DEVELOPERS" type="fix">48134 - release system resources when using Picture.resize()</action>
            <action dev="POI-DEVELOPERS" type="fix">48087 - avoid NPE in XSSFChartSheet  when calling methods of the superclass</action>
            <action dev="POI-DEVELOPERS" type="fix">48038 - handle reading HWPF stylesheets from non zero offsets</action>
index d526d6de9df76a9a0b8634605556486a6ea79c3d..d626a8234121ddedb7683c0fd76c3d6bcad68e5a 100644 (file)
@@ -634,7 +634,24 @@ public final class HSSFSheet implements org.apache.poi.ss.usermodel.Sheet {
         return _sheet.getPageSettings().getHCenter().getHCenter();
     }
 
+    /**
+     * Sets the arabic property for this sheet, will make it right to left.
+     * @param value true for arabic, false otherwise.
+     */
+    public void setArabic(boolean value)
+    {
+           _sheet.getWindowTwo().setArabic(value);
+    }
 
+    /**
+     * Gets the arabic property for this sheet.
+     *
+     * @return whther the arabic mode is set
+     */
+    public boolean isArabic()
+    {
+           return _sheet.getWindowTwo().getArabic();
+    }
 
     /**
      * removes a merged region of cells (hence letting them free)
index ee8e0e8245d39396ec516df5f8b1c07b13e09445..bdb15563b8e1cc78aaa6d535bc57749f2c591cde 100644 (file)
@@ -802,4 +802,17 @@ public final class TestHSSFSheet extends BaseTestSheet {
         assertFalse(cs.getFont(wbComplex).getItalic());
         assertEquals(HSSFFont.BOLDWEIGHT_BOLD, cs.getFont(wbComplex).getBoldweight());
     }
+
+    /**
+     * Tests the arabic setting
+     */
+    public void testArabic() {
+        HSSFWorkbook wb = new HSSFWorkbook();
+        HSSFSheet s = wb.createSheet();
+
+        assertEquals(false, s.isArabic());
+        s.setArabic(true);
+        assertEquals(true, s.isArabic());
+    }
+
 }