* it should have recovered the CTHdrFtr object encapsulated within the XWPFHeaderFooter object
* that had previoulsy been instantiated in the createHeader(int, XWPFParagraph[]) or
* createFooter(int, XWPFParagraph[]) methods.
*/
private CTHdrFtr buildHdrFtr(String pStyle, XWPFParagraph[] paragraphs, XWPFHeaderFooter wrapper) {
CTHdrFtr ftr = wrapper._getHdrFtr();
if (paragraphs != null) {
for (int i = 0 ; i < paragraphs.length ; i++) {
CTP p = ftr.addNewP();
ftr.setPArray(i, paragraphs[i].getCTP());
}
}
else {
CTP p = ftr.addNewP();
byte[] rsidr = doc.getDocument().getBody().getPArray()[0].getRsidR();
byte[] rsidrdefault = doc.getDocument().getBody().getPArray()[0].getRsidRDefault();
p.setRsidP(rsidr);
p.setRsidRDefault(rsidrdefault);
CTPPr pPr = p.addNewPPr();