poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1681756 - in /poi/trunk/src: java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java testcases/org/apache/poi/hssf/usermodel/TestBugs.java
Date Tue, 26 May 2015 13:46:21 GMT
Author: nick
Date: Tue May 26 13:46:20 2015
New Revision: 1681756

URL: http://svn.apache.org/r1681756
Log:
Fix NPOIFS to handle dodgy excel-95 file from bug #46904

Modified:
    poi/trunk/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java
    poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java

Modified: poi/trunk/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java?rev=1681756&r1=1681755&r2=1681756&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java (original)
+++ poi/trunk/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java Tue May 26 13:46:20
2015
@@ -436,7 +436,7 @@ public class NPOIFSFileSystem extends Bl
        List<BATBlock> sbats = new ArrayList<BATBlock>();
        _mini_store     = new NPOIFSMiniStore(this, _property_table.getRoot(), sbats, _header);
        nextAt = _header.getSBATStart();
-       for(int i=0; i<_header.getSBATCount(); i++) {
+       for(int i=0; i<_header.getSBATCount() && nextAt != POIFSConstants.END_OF_CHAIN;
i++) {
           loopDetector.claim(nextAt);
           ByteBuffer fatData = getBlockAt(nextAt);
           sfat = BATBlock.createBATBlock(bigBlockSize, fatData);

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java?rev=1681756&r1=1681755&r2=1681756&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java Tue May 26 13:46:20
2015
@@ -1578,8 +1578,6 @@ public final class TestBugs extends Base
                     "The supplied spreadsheet seems to be Excel"
             ));
         }
-        // TODO Fix this to work with NPOIFS as well
-/*
         try {
             NPOIFSFileSystem fs = new NPOIFSFileSystem(
                     HSSFITestDataProvider.instance.openWorkbookStream("46904.xls"));
@@ -1590,7 +1588,6 @@ public final class TestBugs extends Base
                     "The supplied spreadsheet seems to be Excel"
             ));
         }
-*/
     }
 
     /**



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


Mime
View raw message