View | Details | Raw Unified | Return to bug 45592
Collapse All | Expand All

(-)src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java (+19 lines)
Lines 16-26 Link Here
16
==================================================================== */
16
==================================================================== */
17
package org.apache.poi.xwpf.usermodel;
17
package org.apache.poi.xwpf.usermodel;
18
18
19
import javax.xml.namespace.QName;
20
19
import org.apache.poi.xwpf.model.XMLParagraph;
21
import org.apache.poi.xwpf.model.XMLParagraph;
20
import org.apache.poi.xwpf.XWPFDocument;
22
import org.apache.poi.xwpf.XWPFDocument;
23
import org.apache.xmlbeans.XmlObject;
21
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP;
24
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP;
25
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTPicture;
22
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTR;
26
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTR;
23
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTText;
27
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTText;
28
import org.w3c.dom.NodeList;
29
import org.w3c.dom.Text;
24
30
25
/**
31
/**
26
 * Sketch of XWPF paragraph class
32
 * Sketch of XWPF paragraph class
Lines 49-54 Link Here
49
                        texts[k].getStringValue()
55
                        texts[k].getStringValue()
50
                );
56
                );
51
            }
57
            }
58
            // loop over pictures with text
59
            CTPicture[] picts = rs[j].getPictArray();
60
            for (int k = 0; k < picts.length; k++) {
61
              XmlObject[] t = picts[k].selectPath("declare namespace w='http://schemas.openxmlformats.org/wordprocessingml/2006/main' .//w:t");
62
              for (int m = 0; m < t.length; m++) {
63
                NodeList kids = t[m].getDomNode().getChildNodes();
64
                for (int n = 0; n < kids.getLength(); n++) {
65
                  if (kids.item(n) instanceof Text) {
66
                    text.append("\n" + kids.item(n).getNodeValue());
67
                  }
68
                }
69
              }
70
            }
52
        }
71
        }
53
    }
72
    }
54
    
73
    
(-)src/ooxml/java/org/apache/poi/xwpf/XWPFDocument.java (-4 / +8 lines)
Lines 108-119 Link Here
108
			{
108
			{
109
				comments.add(new XWPFComment(ctcomment));
109
				comments.add(new XWPFComment(ctcomment));
110
			}
110
			}
111
	    for(CTTbl table : getDocumentBody().getTblArray())
112
	    {
113
	      tables.add(new XWPFTable(table));
114
	    }
111
			
115
			
112
			for(CTTbl table : getDocumentBody().getTblArray())
113
			{
114
				tables.add(new XWPFTable(table));
115
			}
116
		}
116
		}
117
		for(CTTbl table : getDocumentBody().getTblArray())
118
		{
119
			tables.add(new XWPFTable(table));
120
		}
117
		
121
		
118
        this.embedds = new LinkedList<PackagePart>();
122
        this.embedds = new LinkedList<PackagePart>();
119
        for(PackageRelationship rel : getCorePart().getRelationshipsByType(OLE_OBJECT_REL_TYPE)) {
123
        for(PackageRelationship rel : getCorePart().getRelationshipsByType(OLE_OBJECT_REL_TYPE)) {

Return to bug 45592