diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index a5e5baaff..7725c909d 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -34,6 +34,7 @@ + 47970 - added a method to set arabic mode in HSSFSheet 48134 - release system resources when using Picture.resize() 48087 - avoid NPE in XSSFChartSheet when calling methods of the superclass 48038 - handle reading HWPF stylesheets from non zero offsets diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java b/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java index d526d6de9..d626a8234 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java @@ -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) diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java index ee8e0e824..bdb15563b 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java @@ -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()); + } + }