public CTTextBody processText(org.opendope.SmartArt.dataHierarchy.ListItem thisListItem, CTPt thisPoint) { CTTextBody textBody = thisPoint.getT(); if (textBody!=null) { TextBody tb = getDataHierarchyObjectFactory().createTextBody(); thisListItem.setTextBody(tb); for(CTTextParagraph p : textBody.getP() ) { if (!p.getEGTextRun().isEmpty() && p.getEGTextRun().get(0) instanceof org.docx4j.dml.CTRegularTextRun ) { // TODO; assumes a single r child, which is // all we handle. ie this model doesn't support // multiple runs, some of which formatted org.docx4j.dml.CTRegularTextRun run = (org.docx4j.dml.CTRegularTextRun)p.getEGTextRun().get(0); tb.getP().add( run.getT() ); } } } return textBody; }
artificialList.addAll(sp.getTxSp().getTxBody().getP());
private Shape createParagraphShape(CTTextParagraph paragraph) throws JAXBException { Shape paragraphShape = (Shape) XmlUtils.unmarshalString(PARAGRAPH_SHAPE, org.pptx4j.jaxb.Context.jcPML, Shape.class); paragraphShape.getTxBody().getP().add(paragraph); return paragraphShape; }
private CTTableCell createTableCell(Collection<CTTextParagraph> children) throws JAXBException { String contents = "<a:tc xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\">" + " <a:txBody>" + " <a:bodyPr/>" + " <a:lstStyle/>" + " </a:txBody>" + "</a:tc>"; CTTableCell ctTableCell = (CTTableCell)XmlUtils.unmarshalString(contents, org.docx4j.jaxb.Context.jc, CTTableCell.class); ctTableCell.getTxBody().getP().addAll(children); return ctTableCell; }
public CTTextBody processText(org.opendope.SmartArt.dataHierarchy.ListItem thisListItem, CTPt thisPoint) { CTTextBody textBody = thisPoint.getT(); if (textBody!=null) { TextBody tb = getDataHierarchyObjectFactory().createTextBody(); thisListItem.setTextBody(tb); for(CTTextParagraph p : textBody.getP() ) { if (!p.getEGTextRun().isEmpty() && p.getEGTextRun().get(0) instanceof org.docx4j.dml.CTRegularTextRun ) { // TODO; assumes a single r child, which is // all we handle. ie this model doesn't support // multiple runs, some of which formatted org.docx4j.dml.CTRegularTextRun run = (org.docx4j.dml.CTRegularTextRun)p.getEGTextRun().get(0); tb.getP().add( run.getT() ); } } } return textBody; }
private Object processAnonymousBlockBox(AnonymousBlockBox anonymousBlockBox, TraversalSettings settings) throws Docx4JException, JAXBException { List<Object> children = traverseChildren(anonymousBlockBox, settings); // if(settings.isInTableCell()) { // return children; // } else { // return createParagraphShape(createParagraph(children)); // } CTTextParagraph paragraph = createParagraph(children); if(settings.isInTableCell()) { return children; // or paragraph? } else { Shape paragraphShape = settings.getParagraphShape(); if (paragraphShape==null) { paragraphShape = createParagraphShape(paragraph); settings.setParagraphShape(paragraphShape); } else { // Add this a:p to existing p:txBody paragraphShape.getTxBody().getP().add(paragraph); } return paragraphShape; } }
artificialList.addAll(sp.getTxSp().getTxBody().getP());
private Object processParagraph(BlockBox blockBox, TraversalSettings settings) throws JAXBException, Docx4JException { // traverse TraversalSettings localSettings = settings.clone(); localSettings.setInTableCell(false); List<Object> children = traverseChildren(blockBox, localSettings); settings.setCssMap(null); CTTextParagraph paragraph = createParagraph(children); if(settings.isInTableCell()) { return paragraph; } else { Shape paragraphShape = settings.getParagraphShape(); if (paragraphShape==null) { paragraphShape = createParagraphShape(paragraph); settings.setParagraphShape(paragraphShape); } else { // Add this a:p to existing p:txBody paragraphShape.getTxBody().getP().add(paragraph); } return paragraphShape; } }