You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by se...@apache.org on 2011/07/07 13:39:00 UTC
svn commit: r1143769 - in /poi/trunk/src/scratchpad/src/org/apache/poi/hwpf:
HWPFDocument.java extractor/WordExtractor.java model/FIBLongHandler.java
Author: sergey
Date: Thu Jul 7 11:38:59 2011
New Revision: 1143769
URL: http://svn.apache.org/viewvc?rev=1143769&view=rev
Log:
add content of main text box to document text
Modified:
poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/HWPFDocument.java
poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/WordExtractor.java
poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/FIBLongHandler.java
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/HWPFDocument.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/HWPFDocument.java?rev=1143769&r1=1143768&r2=1143769&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/HWPFDocument.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/HWPFDocument.java Thu Jul 7 11:38:59 2011
@@ -364,6 +364,17 @@ public final class HWPFDocument extends
}
/**
+ * Returns the range which covers all the Endnotes.
+ */
+ public Range getMainTextboxRange() {
+ return new Range(
+ _cpSplit.getMainTextboxStart(),
+ _cpSplit.getMainTextboxEnd(),
+ this
+ );
+ }
+
+ /**
* Returns the range which covers all "Header Stories".
* A header story contains a header, footer, end note
* separators and footnote separators.
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/WordExtractor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/WordExtractor.java?rev=1143769&r1=1143768&r2=1143769&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/WordExtractor.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/WordExtractor.java Thu Jul 7 11:38:59 2011
@@ -120,6 +120,12 @@ public final class WordExtractor extends
return getParagraphText(r);
}
+ public String[] getMainTextboxText() {
+ Range r = doc.getMainTextboxRange();
+
+ return getParagraphText(r);
+ }
+
public String[] getEndnoteText() {
Range r = doc.getEndnoteRange();
@@ -251,6 +257,7 @@ public final class WordExtractor extends
ArrayList<String> text = new ArrayList<String>();
text.addAll(Arrays.asList(getParagraphText()));
+ text.addAll(Arrays.asList(getMainTextboxText()));
text.addAll(Arrays.asList(getFootnoteText()));
text.addAll(Arrays.asList(getEndnoteText()));
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/FIBLongHandler.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/FIBLongHandler.java?rev=1143769&r1=1143768&r2=1143769&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/FIBLongHandler.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/FIBLongHandler.java Thu Jul 7 11:38:59 2011
@@ -27,13 +27,35 @@ public final class FIBLongHandler {
public static final int CBMAC = 0;
public static final int PRODUCTCREATED = 1;
public static final int PRODUCTREVISED = 2;
- public static final int CCPTEXT = 3;
- public static final int CCPFTN = 4;
- public static final int CCPHDD = 5;
- public static final int CCPMCR = 6;
- public static final int CCPATN = 7;
- public static final int CCPEDN = 8;
- public static final int CCPTXBX = 9;
+ /**
+ * Pointer to length of main document text stream 1
+ */
+ public static final int CCPTEXT = 3;
+ /**
+ * Pointer to length of footnote subdocument text stream
+ */
+ public static final int CCPFTN = 4;
+ /**
+ * Pointer to length of header subdocument text stream
+ */
+ public static final int CCPHDD = 5;
+ /**
+ * Pointer to length of macro subdocument text stream, which should now
+ * always be 0
+ */
+ public static final int CCPMCR = 6;
+ /**
+ * Pointer to length of annotation subdocument text stream
+ */
+ public static final int CCPATN = 7;
+ /**
+ * Pointer to length of endnote subdocument text stream
+ */
+ public static final int CCPEDN = 8;
+ /**
+ * Pointer to length of textbox subdocument text stream
+ */
+ public static final int CCPTXBX = 9;
public static final int CCPHDRTXBX = 10;
public static final int PNFBPCHPFIRST = 11;
public static final int PNCHPFIRST = 12;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org