ASF Bugzilla – Attachment 25605 Details for
Bug 49455
[patch] please insert the content of fldSimple fields into the XWPFWordTextExtractor output
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
a patch
poi-fldsimple.patch (text/plain), 2.17 KB, created by
Antoni Mylka
on 2010-06-17 11:16:14 UTC
(
hide
)
Description:
a patch
Filename:
MIME Type:
Creator:
Antoni Mylka
Created:
2010-06-17 11:16:14 UTC
Size:
2.17 KB
patch
obsolete
>Index: src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java >=================================================================== >--- src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java (revision 955183) >+++ src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java (working copy) >@@ -44,6 +44,7 @@ > 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.CTTbl; >@@ -123,6 +124,9 @@ > for (CTRunTrackChange c : paragraph.getInsArray()) { > rs.addAll( Arrays.asList(c.getRArray()) ); > } >+ for (CTSimpleField f : paragraph.getFldSimpleArray()) { >+ rs.addAll( Arrays.asList(f.getRArray()) ); >+ } > > // Get text of the paragraph > for (int j = 0; j < rs.size(); j++) { >Index: src/ooxml/testcases/org/apache/poi/xwpf/extractor/TestXWPFWordExtractor.java >=================================================================== >--- src/ooxml/testcases/org/apache/poi/xwpf/extractor/TestXWPFWordExtractor.java (revision 955183) >+++ src/ooxml/testcases/org/apache/poi/xwpf/extractor/TestXWPFWordExtractor.java (working copy) >@@ -237,4 +237,16 @@ > // Now check the first paragraph in total > assertTrue(extractor.getText().contains("a\tb\n")); > } >+ >+ /** >+ * 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")); >+ } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 49455
: 25605 |
25606