]> source.dussan.org Git - poi.git/commitdiff
Fix bug (broken junit) introduced in r773412. Also hooked up test.
authorJosh Micich <josh@apache.org>
Mon, 11 May 2009 00:50:45 +0000 (00:50 +0000)
committerJosh Micich <josh@apache.org>
Mon, 11 May 2009 00:50:45 +0000 (00:50 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@773441 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/hssf/record/aggregates/ChartSubstreamRecordAggregate.java
src/testcases/org/apache/poi/hssf/HSSFTests.java
src/testcases/org/apache/poi/hssf/extractor/TestExcelExtractor.java

index bb135174d58101cf604ef2bee5f8238168ca69cb..9b1d14d5624d18876fe635b7c2050bcf2f06f70f 100644 (file)
@@ -25,6 +25,7 @@ import org.apache.poi.hssf.record.BOFRecord;
 import org.apache.poi.hssf.record.EOFRecord;\r
 import org.apache.poi.hssf.record.Record;\r
 import org.apache.poi.hssf.record.RecordBase;\r
+import org.apache.poi.hssf.record.UnknownRecord;\r
 \r
 /**\r
  * Manages the all the records associated with a chart sub-stream.<br/>\r
@@ -47,6 +48,11 @@ public final class ChartSubstreamRecordAggregate extends RecordAggregate {
                while (rs.peekNextClass() != EOFRecord.class) {\r
                        if (PageSettingsBlock.isComponentRecord(rs.peekNextSid())) {\r
                                if (_psBlock != null) {\r
+                                       if (rs.peekNextSid() == UnknownRecord.HEADER_FOOTER_089C) {\r
+                                               // test samples: 45538_classic_Footer.xls, 45538_classic_Header.xls\r
+                                               _psBlock.addLateHeaderFooter(rs.getNext());\r
+                                               continue;\r
+                                       }\r
                                        throw new IllegalStateException(\r
                                                        "Found more than one PageSettingsBlock in chart sub-stream");\r
                                }\r
index fac6e0db308362be5ba2116c4452dd978459a40b..856e31cb427b3c40173e2ffd0f9a2431d9fa8a02 100644 (file)
@@ -48,10 +48,7 @@ public final class HSSFTests {
         suite.addTest(AllUserModelTests.suite());
         suite.addTest(AllRecordTests.suite());
         suite.addTest(AllHSSFUtilTests.suite());
-
-        if (false) { // TODO - hook this test up
-            suite.addTest(new TestSuite(TestExcelExtractor.class));
-        }
+        suite.addTest(new TestSuite(TestExcelExtractor.class));
         suite.addTest(new TestSuite(TestEventRecordFactory.class));
         suite.addTest(new TestSuite(TestModelFactory.class));
         suite.addTest(AllSSFormulaTests.suite());
index c820f2c9bc176f30e423b20ee715ae88a6a2909a..25909918b38c8a28146ba431585538e6f8d177a8 100644 (file)
@@ -165,7 +165,7 @@ public final class TestExcelExtractor extends TestCase {
                );
        }
        
-       public void testWithComments() throws Exception {
+       public void testWithComments() {
                ExcelExtractor extractor = createExtractor("SimpleWithComments.xls");
                extractor.setIncludeSheetNames(false);
 
@@ -187,7 +187,7 @@ public final class TestExcelExtractor extends TestCase {
                );
        }
        
-       public void testWithBlank() throws Exception {
+       public void testWithBlank() {
                ExcelExtractor extractor = createExtractor("MissingBits.xls");
                String def = extractor.getText();
                extractor.setIncludeBlankCells(true);
@@ -277,7 +277,7 @@ public final class TestExcelExtractor extends TestCase {
        /**
         * Test that we get text from headers and footers
         */
-       public void test45538() throws Exception {
+       public void test45538() {
                String[] files = {
                        "45538_classic_Footer.xls", "45538_form_Footer.xls",    
                        "45538_classic_Header.xls", "45538_form_Header.xls"