diff --git a/src/documentation/content/xdocs/changes.xml b/src/documentation/content/xdocs/changes.xml index 0317cd9d2..85e9d58f8 100644 --- a/src/documentation/content/xdocs/changes.xml +++ b/src/documentation/content/xdocs/changes.xml @@ -54,6 +54,7 @@ Created a common interface for handling Excel files, irrespective of if they are .xls or .xlsx + 45537 - Include headers and footers (of slides and notes) in the extracted text from HSLF 45472 - Fixed incorrect default row height in OpenOffice 2.3 44692 - HSSFPicture.resize() stretched image when there was a text next to it 45543 - Optionally extract comment text with PowerPointExtractor, and initial hslf model support for comments diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index ce1869e2c..09f91c20f 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -51,6 +51,7 @@ Created a common interface for handling Excel files, irrespective of if they are .xls or .xlsx + 45537 - Include headers and footers (of slides and notes) in the extracted text from HSLF 45472 - Fixed incorrect default row height in OpenOffice 2.3 44692 - HSSFPicture.resize() stretched image when there was a text next to it 45543 - Optionally extract comment text with PowerPointExtractor, and initial hslf model support for comments diff --git a/src/java/org/apache/poi/hssf/eventusermodel/FormatTrackingHSSFListener.java b/src/java/org/apache/poi/hssf/eventusermodel/FormatTrackingHSSFListener.java index 355a9b71f..ff34958e6 100644 --- a/src/java/org/apache/poi/hssf/eventusermodel/FormatTrackingHSSFListener.java +++ b/src/java/org/apache/poi/hssf/eventusermodel/FormatTrackingHSSFListener.java @@ -16,11 +16,7 @@ ==================================================================== */ package org.apache.poi.hssf.eventusermodel; -import java.text.DateFormat; -import java.text.DecimalFormat; -import java.text.SimpleDateFormat; import java.util.ArrayList; -import java.util.Date; import java.util.Hashtable; import java.util.List; import java.util.Map; @@ -33,7 +29,6 @@ import org.apache.poi.hssf.record.NumberRecord; import org.apache.poi.hssf.record.Record; import org.apache.poi.hssf.usermodel.HSSFDataFormat; import org.apache.poi.hssf.usermodel.HSSFDataFormatter; -import org.apache.poi.hssf.usermodel.HSSFDateUtil; /** * A proxy HSSFListener that keeps track of the document @@ -50,6 +45,13 @@ public class FormatTrackingHSSFListener implements HSSFListener { this.childListener = childListener; } + protected int getNumberOfCustomFormats() { + return customFormatRecords.size(); + } + protected int getNumberOfExtendedFormats() { + return xfRecords.size(); + } + /** * Process this record ourselves, and then * pass it on to our child listener diff --git a/src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java b/src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java index 95900a45e..865471eef 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java +++ b/src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java @@ -176,11 +176,13 @@ public class PowerPointExtractor extends POIOLE2TextExtractor for(int i=0; i<_slides.length; i++) { Slide slide = _slides[i]; + // Slide header, if set HeadersFooters hf = slide.getHeadersFooters(); - if(hf != null && hf.getHeaderText() != null) { + if(hf != null && hf.isHeaderVisible() && hf.getHeaderText() != null) { ret.append(hf.getHeaderText() + "\n"); } + // Slide text TextRun[] runs = slide.getTextRuns(); for(int j=0; j 0) { for(int j=0; j 5); + assertTrue(listener.getNumberOfExtendedFormats() > 5); + + // Now check we can turn all the numeric + // cells into strings without error + for(int i=0; i 0); + } } - if(cvr != null) { - // Should always give us a string - String s = listener.formatNumberDateCell(cvr); - assertNotNull(s); - assertTrue(s.length() > 0); - } + // TODO - test some specific format strings } - - // TODO - test some specific format strings } private static final class MockHSSFListener implements HSSFListener {