poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1090301 - 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/TestXSSFBugs.java
Date Fri, 08 Apr 2011 15:41:37 GMT
Author: nick
Date: Fri Apr  8 15:41:36 2011
New Revision: 1090301

URL: http://svn.apache.org/viewvc?rev=1090301&view=rev
Log:
More test for bug #49381 / #50884 - xssf freeze panes

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/TestXSSFBugs.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=1090301&r1=1090300&r2=1090301&view=diff
==============================================================================
--- poi/trunk/src/documentation/content/xdocs/status.xml (original)
+++ poi/trunk/src/documentation/content/xdocs/status.xml Fri Apr  8 15:41:36 2011
@@ -34,6 +34,7 @@
 
     <changes>
         <release version="3.8-beta3" date="2011-??-??">
+           <action dev="poi-developers" type="fix">50884 - XSSF and HSSF freeze panes
now behave the same</action>
            <action dev="poi-developers" type="add">Support for adding a table to a
XSSFSheet</action>
            <action dev="poi-developers" type="add">Improve HSMF MAPIMessage access
to the HTML and RTF versions of the message body (where available)</action>
            <action dev="poi-developers" type="add">Add new method to HSMF of MAPIMessage.has7BitEncodingStrings()
to make it easier to decide when encoding guessing is needed</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=1090301&r1=1090300&r2=1090301&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 Fri Apr  8 15:41:36
2011
@@ -443,14 +443,23 @@ public class XSSFSheet extends POIXMLDoc
      */
     public void createFreezePane(int colSplit, int rowSplit, int leftmostColumn, int topRow)
{
         CTPane pane = getPane();
-        if (colSplit > 0) pane.setXSplit(colSplit);
-        if (rowSplit > 0) pane.setYSplit(rowSplit);
+        if (colSplit > 0) { 
+           pane.setXSplit(colSplit);
+        } else {
+           pane.unsetXSplit();
+        }
+        if (rowSplit > 0) {
+           pane.setYSplit(rowSplit);
+        } else {
+           pane.unsetYSplit();
+        }
+        
         pane.setState(STPaneState.FROZEN);
         if (rowSplit == 0) {
-            pane.setTopLeftCell(new CellReference(0, topRow).formatAsString());
+            pane.setTopLeftCell(new CellReference(0, leftmostColumn).formatAsString());
             pane.setActivePane(STPane.TOP_RIGHT);
         } else if (colSplit == 0) {
-            pane.setTopLeftCell(new CellReference(rowSplit, 0).formatAsString());
+            pane.setTopLeftCell(new CellReference(topRow, 0).formatAsString());
             pane.setActivePane(STPane.BOTTOM_LEFT);
         } else {
             pane.setTopLeftCell(new CellReference(topRow, leftmostColumn).formatAsString());

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java?rev=1090301&r1=1090300&r2=1090301&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java Fri Apr
 8 15:41:36 2011
@@ -999,6 +999,29 @@ public final class TestXSSFBugs extends 
           assertEquals(rowSplit,       paneInfo.getHorizontalSplitPosition());
           assertEquals(leftmostColumn, paneInfo.getVerticalSplitLeftColumn());
           assertEquals(topRow,         paneInfo.getHorizontalSplitTopRow());
+          
+          
+          // Now a row only freezepane
+          s.createFreezePane(0, 3);
+          paneInfo = s.getPaneInformation();
+          
+          assertEquals(0,  paneInfo.getVerticalSplitPosition());
+          assertEquals(3,  paneInfo.getHorizontalSplitPosition());
+          if(wb == wbs[0]) {
+             assertEquals(64, paneInfo.getVerticalSplitLeftColumn()); // HSSF
+          } else {
+             assertEquals(0,  paneInfo.getVerticalSplitLeftColumn()); // XSSF
+          }
+          assertEquals(3,  paneInfo.getHorizontalSplitTopRow());
+          
+          // Now a column only freezepane
+          s.createFreezePane(4, 0);
+          paneInfo = s.getPaneInformation();
+          
+          assertEquals(4,  paneInfo.getVerticalSplitPosition());
+          assertEquals(0,  paneInfo.getHorizontalSplitPosition());
+          assertEquals(4 , paneInfo.getVerticalSplitLeftColumn());
+          assertEquals(0,  paneInfo.getHorizontalSplitTopRow());
        }
     }
 }



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


Mime
View raw message