public static boolean isEmpty(PPr pPr) { return (pPr == null) || (isEmpty((PPrBase)pPr) && isEmpty(pPr.getRPr()) && isEmpty(pPr.getSectPr() ) ); }
public static PPr apply(PPr source, PPr destination) { if (!isEmpty(source)) { if (destination == null) destination = Context.getWmlObjectFactory().createPPr(); apply((PPrBase)source, (PPrBase)destination); destination.setRPr(apply(source.getRPr(), destination.getRPr())); destination.setSectPr(apply(source.getSectPr(), destination.getSectPr())); } return destination; }
@Override public void addBlankLines(final int count) { if (count > 0) { // now add empty for spacing PPr pPr = myFactory.createPPr(); myBlockFormatProvider.getPPr(pPr); PPr explicitPPr = myDocxHelper.getExplicitPPr(pPr); final ParaRPr rPr = explicitPPr.getRPr(); BigInteger size = rPr.getSz().getVal().max(rPr.getSzCs().getVal()); addBlankLine(size.multiply(BigInteger.valueOf(count)), null); } }
Style thisStyle = myDocx.getStyle(myBaseStyleId); if (thisStyle != null) { final ParaRPr paraRPr = myDocx.getP().getPPr().getRPr(); final RPr pr = myDocx.getHelper().getExplicitRPr(thisStyle.getRPr()); if (!myHighlightShadingColor.isEmpty()) {
@Override public P createP(String style) { P p = myFactory.createP(); PPr pPr = myFactory.createPPr(); p.setPPr(pPr); myParaContainer.addP(p); if (style == null) { myBlockFormatProvider.getPPr(pPr); myBlockFormatProvider.adjustPPrForFormatting(pPr); if (StyleUtil.isEmpty(p.getPPr())) { p.setPPr(null); } else if (StyleUtil.isEmpty(p.getPPr().getRPr())) { p.getPPr().setRPr(null); } } else { createPStyle(style); } return p; }
@Override public void getPPr(final PPr pPr) { // Create object for pStyle if one does not already exist PPrBase.PStyle basePStyle = myDocx.getFactory().createPPrBasePStyle(); pPr.setPStyle(basePStyle); basePStyle.setVal(myBaseStyleId); // Create object for rPr ParaRPr pararpr = pPr.getRPr(); if (pararpr == null) { pararpr = myDocx.getFactory().createParaRPr(); pPr.setRPr(pararpr); } // handle inheritance BlockFormatProvider<T> parent = getStyleParent(); if (parent != null) { PPr ppr = myDocx.getFactory().createPPr(); parent.getPPr(ppr); ppr = myDocx.getHelper().getExplicitPPr(ppr); //PPr ppr = myDocx.getFactory().createPPr(); //Style parentStyle = myDocx.getStyle(parent.getStyleId()); //if (parentStyle != null) { // myDocx.getHelper().setPPrBase(ppr, parentStyle.getPPr(), false); //} //parent.getPPr(ppr); inheritParentFormat(pPr, ppr); } // allow adjustments adjustPPr(pPr); }
/** * Applies the style of the given paragraph to the given content object (if the content object is a Run). * * @param p the paragraph whose style to use. * @param run the Run to which the style should be applied. */ public static void applyParagraphStyle(P p, R run) { if (p.getPPr() != null && p.getPPr().getRPr() != null) { RPr runProperties = new RPr(); StyleUtil.apply(p.getPPr().getRPr(), runProperties); run.setRPr(runProperties); } }
public static boolean isEmpty(PPr pPr) { return (pPr == null) || (isEmpty((PPrBase)pPr) && isEmpty(pPr.getRPr()) && isEmpty(pPr.getSectPr() ) ); }
public static PPr apply(PPr source, PPr destination) { if (!isEmpty(source)) { if (destination == null) destination = Context.getWmlObjectFactory().createPPr(); apply((PPrBase)source, (PPrBase)destination); destination.setRPr(apply(source.getRPr(), destination.getRPr())); destination.setSectPr(apply(source.getSectPr(), destination.getSectPr())); } return destination; }