You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ye...@apache.org on 2009/09/13 19:49:46 UTC

svn commit: r814358 - in /poi/trunk/src: documentation/content/xdocs/status.xml ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java

Author: yegor
Date: Sun Sep 13 17:49:46 2009
New Revision: 814358

URL: http://svn.apache.org/viewvc?rev=814358&view=rev
Log:
fixed  XSSFSheet.setColumnWidth to produce XML compatible with Mac Excel 2008, see Bugzilla 47581

Modified:
    poi/trunk/src/documentation/content/xdocs/status.xml
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java

Modified: poi/trunk/src/documentation/content/xdocs/status.xml
URL: http://svn.apache.org/viewvc/poi/trunk/src/documentation/content/xdocs/status.xml?rev=814358&r1=814357&r2=814358&view=diff
==============================================================================
--- poi/trunk/src/documentation/content/xdocs/status.xml (original)
+++ poi/trunk/src/documentation/content/xdocs/status.xml Sun Sep 13 17:49:46 2009
@@ -33,6 +33,7 @@
 
     <changes>
         <release version="3.5-beta7" date="2009-??-??">
+           <action dev="POI-DEVELOPERS" type="fix">47581 - fixed  XSSFSheet.setColumnWidth to produce XML compatible with Mac Excel 2008</action>
            <action dev="POI-DEVELOPERS" type="fix">47734 - removed unnecessary svn:executable flag from files in SVN trunk</action>
            <action dev="POI-DEVELOPERS" type="fix">47543 - added javadoc how to avoid Excel crash when creating too many HSSFRichTextString cells</action>
            <action dev="POI-DEVELOPERS" type="fix">47813 - fixed problems with XSSFWorkbook.removeSheetAt when workbook contains chart</action>

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java?rev=814358&r1=814357&r2=814358&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java Sun Sep 13 17:49:46 2009
@@ -1675,6 +1675,7 @@
         if(width > 255*256) throw new IllegalArgumentException("The maximum column width for an individual cell is 255 characters.");
 
         columnHelper.setColWidth(columnIndex, (double)width/256);
+        columnHelper.setCustomWidth(columnIndex, true);
     }
 
     public void setDefaultColumnStyle(int column, CellStyle style) {

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java?rev=814358&r1=814357&r2=814358&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java Sun Sep 13 17:49:46 2009
@@ -695,6 +695,7 @@
         assertEquals(2, col.getMin());
         assertEquals(2, col.getMax());
         assertEquals(22.0, col.getWidth(), 0.0);
+        assertTrue(col.getCustomWidth());
 
         // Now set another
         sheet.setColumnWidth(3, 33 * 256);
@@ -708,10 +709,12 @@
         assertEquals(2, col.getMin()); // POI 1
         assertEquals(2, col.getMax());
         assertEquals(22.0, col.getWidth(), 0.0);
+        assertTrue(col.getCustomWidth());
 
         col = cols.getColArray(1);
         assertEquals(4, col.getMin()); // POI 3
         assertEquals(4, col.getMax());
         assertEquals(33.0, col.getWidth(), 0.0);
+        assertTrue(col.getCustomWidth());
     }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org