/** * Convenience method to getBody().getContent() * @since 2.7 */ public List<Object> getContent() { return getBody().getContent(); }
for (Object o : document.getBody().getContent() ) { if (document.getBody().getSectPr()!=null) { sectPrs.add(document.getBody().getSectPr()); List<Object> all = document.getBody().getContent(); Object last = all.get( all.size()-1 ); if (last instanceof P document.getBody().setSectPr(thisSectPr); ((P) last).getPPr().setSectPr(null); sectPrs.remove(thisSectPr); document.getBody().setSectPr(Context.getWmlObjectFactory().createSectPr()); sectPrs.add(document.getBody().getSectPr());
/** * Create an instance of {@link Body } * */ public Body createBody() { return new Body(); }
/** The dummy section wrappers only contains one section with all the document. Therefore * any sections within the document are ignored in the conversion process. As it doesn't * need to check for sections it is faster and the html-Output only uses one section.<br> * It will use the Header/Footer of the body sectPr. This isn't correct, if there are * several Sections in the document, but to find the correct SectPr it would need to check * the document content - and the aim of this method is a low overhead. * * @param wmlPackage * @param dummyPageNumbering * @return */ protected static List<ConversionSectionWrapper> processDummy(WordprocessingMLPackage wmlPackage, Document document, RelationshipsPart rels, BooleanDefaultTrue evenAndOddHeaders, boolean dummyPageNumbering) { log.debug("starting"); List<ConversionSectionWrapper> conversionSections = new ArrayList<ConversionSectionWrapper>(); ConversionSectionWrapper currentSectionWrapper = null; HeaderFooterPolicy previousHF = new HeaderFooterPolicy(document.getBody().getSectPr(), null, rels, evenAndOddHeaders); // SectionWrapper does work where sectPr is null (ie document has no body level sectPr), // so document.getBody().getSectPr() is ok currentSectionWrapper = createSectionWrapper( document.getBody().getSectPr(), previousHF, rels, evenAndOddHeaders, 1, document.getBody().getContent(), dummyPageNumbering); conversionSections.add(currentSectionWrapper); return conversionSections; }
clone.getMainDocumentPart().getJaxbElement().getBody().setSectPr(null);
/** * This method is invoked by the JAXB implementation on each instance when unmarshalling completes. * * @param parent * The parent object in the object tree. * @param unmarshaller * The unmarshaller that generated the instance. */ public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { setParent(parent); }
for (Object o : document.getBody().getContent() ) { document.getBody().getSectPr(), previousHF, rels, evenAndOddHeaders, ++conversionSectionIndex, sectionContent, dummyPageNumbering); conversionSections.add(currentSectionWrapper);
body.setSectPr(sectPr); sectPr.setPgSz( page.getPgSz() ); sectPr.setPgMar( page.getPgMar() );
log.debug("sectPr not set by tocFinder"); // will happen when we're adding (as opposed to updating) ToC sectPr = this.wordMLPackage.getMainDocumentPart().getJaxbElement().getBody().getSectPr(); if (sectPr==null) { throw new TocException("No sectPr following ToC");
/** * Sets the value of the body property. * * @param value * allowed object is * {@link Body } * */ public void setBody(Body value) { this.body = value; value.setParent(this); }
private static void movePageBreaks(Body body) { List<Object> elts = body.getContent(); for (Object o : elts) { if (o instanceof P) { updateParagraph((P)o); } } }
/** The dummy section wrappers only contains one section with all the document. Therefore * any sections within the document are ignored in the conversion process. As it doesn't * need to check for sections it is faster and the html-Output only uses one section.<br> * It will use the Header/Footer of the body sectPr. This isn't correct, if there are * several Sections in the document, but to find the correct SectPr it would need to check * the document content - and the aim of this method is a low overhead. * * @param wmlPackage * @param dummyPageNumbering * @return */ protected static List<ConversionSectionWrapper> processDummy(WordprocessingMLPackage wmlPackage, Document document, RelationshipsPart rels, BooleanDefaultTrue evenAndOddHeaders, boolean dummyPageNumbering) { log.debug("starting"); List<ConversionSectionWrapper> conversionSections = new ArrayList<ConversionSectionWrapper>(); ConversionSectionWrapper currentSectionWrapper = null; HeaderFooterPolicy previousHF = new HeaderFooterPolicy(document.getBody().getSectPr(), null, rels, evenAndOddHeaders); // SectionWrapper does work where sectPr is null (ie document has no body level sectPr), // so document.getBody().getSectPr() is ok currentSectionWrapper = createSectionWrapper( document.getBody().getSectPr(), previousHF, rels, evenAndOddHeaders, 1, document.getBody().getContent(), dummyPageNumbering); conversionSections.add(currentSectionWrapper); return conversionSections; }
for (Object o : document.getBody().getContent() ) { if (document.getBody().getSectPr()!=null) { sectPrs.add(document.getBody().getSectPr()); List<Object> all = document.getBody().getContent(); Object last = all.get( all.size()-1 ); if (last instanceof P document.getBody().setSectPr(thisSectPr); ((P) last).getPPr().setSectPr(null); sectPrs.remove(thisSectPr); document.getBody().setSectPr(Context.getWmlObjectFactory().createSectPr()); sectPrs.add(document.getBody().getSectPr());
clone.getMainDocumentPart().getJaxbElement().getBody().setSectPr(null);
SectPr sectPr = template.getMainDocumentPart().getJaxbElement().getBody().getSectPr();
/** * Sets the value of the body property. * * @param value * allowed object is * {@link Body } * */ public void setBody(Body value) { this.body = value; value.setParent(this); }
/** * Create an instance of {@link Body } * */ public Body createBody() { return new Body(); }
return getContent();
for (Object o : document.getBody().getContent() ) { document.getBody().getSectPr(), previousHF, rels, evenAndOddHeaders, ++conversionSectionIndex, sectionContent, dummyPageNumbering); conversionSections.add(currentSectionWrapper);