<changes>
<release version="3.7-beta2" date="2010-??-??">
+ <action dev="POI-DEVELOPERS" type="add">49455 - Insert the content of fldSimple fields into the XWPFWordTextExtractor output</action>
<action dev="POI-DEVELOPERS" type="add">49640 - Fixed parsing formulas containing defined names beginning with an underscore</action>
<action dev="POI-DEVELOPERS" type="add">49538 - Added implementation for POISSON()</action>
<action dev="POI-DEVELOPERS" type="add">49524 - Support for setting cell text to be vertically rotated, via style.setRotation(0xff)</action>
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import java.util.Arrays;
import org.apache.poi.util.Internal;
import org.apache.xmlbeans.XmlCursor;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRunTrackChange;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSdtContentRun;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSdtRun;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSimpleField;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSpacing;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTString;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTText;
for (CTRunTrackChange c : paragraph.getInsList()) {
rs.addAll( c.getRList() );
}
+ for (CTSimpleField f : paragraph.getFldSimpleList()) {
+ rs.addAll( f.getRList() );
+ }
// Get text of the paragraph
for (int j = 0; j < rs.size(); j++) {
assertFalse(text.contains("AUTHOR"));
assertFalse(text.contains("CREATEDATE"));
}
+
+ /**
+ * The output should contain the values of simple fields, those specified
+ * with the fldSimple element (spec sec. 17.16.19)
+ */
+ public void testFldSimpleContent() {
+ XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("FldSimple.docx");
+ XWPFWordExtractor extractor = new XWPFWordExtractor(doc);
+ String text = extractor.getText();
+ assertTrue(text.length() > 0);
+ assertTrue(text.contains("FldSimple.docx"));
+ }
}