public static boolean isEmpty(RStyle rStyle) { return (rStyle == null) || isEmpty(rStyle.getVal()); }
public void finish() { if (stylesInUse != null) { if ((defaultParagraphStyleUsed) && (defaultParagraphStyle != null)) { stylesInUse.add(defaultParagraphStyle.getStyleId() ); if (defaultParagraphStyle.getRPr()!=null && defaultParagraphStyle.getRPr().getRStyle()!=null ) { stylesInUse.add(defaultParagraphStyle.getRPr().getRStyle().getVal() ); } } if ((defaultCharacterStyleUsed) && (defaultCharacterStyle != null)) { stylesInUse.add(defaultCharacterStyle.getStyleId()); } } }
public static RStyle apply(RStyle source, RStyle destination) { if (!isEmpty(source)) { if (destination == null) destination = Context.getWmlObjectFactory().createRStyle(); destination.setVal(source.getVal()); } return destination; }
rStyleVal = rPr.getRStyle().getVal();
@Override protected void handleRPr( HTMLConversionContext conversionContext, PPr pPrDirect, RPr rPrDirect, Element currentParent ) { // Set @class if ( rPrDirect.getRStyle()!=null) { String rStyleVal = rPrDirect.getRStyle().getVal(); Tree<AugmentedStyle> cTree = conversionContext.getStyleTree().getCharacterStylesTree(); org.docx4j.model.styles.Node<AugmentedStyle> asn = cTree.get(rStyleVal); if (asn==null) { getLog().warn("No style node for: " + rStyleVal); } else { currentParent.setAttribute("class", StyleTree.getHtmlClassAttributeValue(cTree, asn) ); } } // Does our rPr contain anything else? StringBuilder inlineStyle = new StringBuilder(); HtmlCssHelper.createCss(conversionContext.getWmlPackage(), rPrDirect, inlineStyle); if (!inlineStyle.toString().equals("") ) { currentParent.setAttribute("style", inlineStyle.toString() ); } }
private RPr getEffectiveRPr(RPr expressRPr) { RPr resolvedRPr = null; if (expressRPr != null && expressRPr.getRStyle() != null ) { String runStyleId = expressRPr.getRStyle().getVal(); resolvedRPr = propertyResolver.getEffectiveRPr(runStyleId); // remove the style, so it is not set by apply below expressRPr.setRStyle(null); } return StyleUtil.apply(expressRPr, resolvedRPr); }
@Override public void apply(R r, Object parent, List<Object> siblings) { if (r.getRPr()!=null && r.getRPr().getRStyle()!=null && !allowedStyleNames.contains(sdp.getNameForStyleID(r.getRPr().getRStyle().getVal()))) { r.getRPr().setRStyle(null); } } }
String runStyleId; if (expressRPr != null && expressRPr.getRStyle() != null ) { runStyleId = expressRPr.getRStyle().getVal(); resolvedRPr = getEffectiveRPr(runStyleId); StyleUtil.apply(resolvedRPr, effectiveRPr);
public RStyle getCopy(RStyle copy, boolean whenNull) { if (copy != null) { RStyle result = myFactory.createRStyle(); result.setVal(copy.getVal()); return result; } if (whenNull) { return myFactory.createRStyle(); } return null; }
final RStyle pStyle = rPr.getRStyle(); if (pStyle != null) { String styleId = pStyle.getVal(); Style style = getStyle(styleId); while (style != null) {
public void finish() { if (stylesInUse != null) { if ((defaultParagraphStyleUsed) && (defaultParagraphStyle != null)) { stylesInUse.add(defaultParagraphStyle.getStyleId() ); if (defaultParagraphStyle.getRPr()!=null && defaultParagraphStyle.getRPr().getRStyle()!=null ) { stylesInUse.add(defaultParagraphStyle.getRPr().getRStyle().getVal() ); } } if ((defaultCharacterStyleUsed) && (defaultCharacterStyle != null)) { stylesInUse.add(defaultCharacterStyle.getStyleId()); } } }
public static RStyle apply(RStyle source, RStyle destination) { if (!isEmpty(source)) { if (destination == null) destination = Context.getWmlObjectFactory().createRStyle(); destination.setVal(source.getVal()); } return destination; }
private RPr getEffectiveRPr(RPr expressRPr) { RPr resolvedRPr = null; if (expressRPr != null && expressRPr.getRStyle() != null ) { String runStyleId = expressRPr.getRStyle().getVal(); resolvedRPr = propertyResolver.getEffectiveRPr(runStyleId); // remove the style, so it is not set by apply below expressRPr.setRStyle(null); } return StyleUtil.apply(expressRPr, resolvedRPr); }
@Override public void apply(R r, Object parent, List<Object> siblings) { if (r.getRPr()!=null && r.getRPr().getRStyle()!=null && !allowedStyleNames.contains(sdp.getNameForStyleID(r.getRPr().getRStyle().getVal()))) { r.getRPr().setRStyle(null); } } }