Package org.docx4j.model

Examples of org.docx4j.model.PropertyResolver


  protected void handleRPr(
        FOConversionContext conversionContext,
        PPr pPrDirect,
        RPr rPrDirect, Element currentParent ) {

      PropertyResolver propertyResolver = conversionContext.getPropertyResolver();
     
     
        try {
          RPr rPr = propertyResolver.getEffectiveRPr(rPrDirect, pPrDirect);
         
       
      if (getLog().isDebugEnabled() && rPr!=null) {         
        getLog().debug(XmlUtils.marshaltoString(rPr, true, true));         
      }
View Full Code Here


    private String defaultFont = null;
  public String getDefaultFont() {
   
    if (defaultFont == null) {
     
        PropertyResolver propertyResolver = wordMLPackage.getMainDocumentPart().getPropertyResolver();
     
      org.docx4j.wml.RFonts rFonts = propertyResolver.getDocumentDefaultRPr().getRFonts();
   
      if (rFonts==null) {
        log.info("No styles/docDefaults/rPrDefault/rPr/rFonts - default to Times New Roman");
        // Yes, Times New Roman is still buried in Word 2007
        defaultFont = "Times New Roman";            
View Full Code Here

        } // otherwise a font might be used in a run with content other than w:t?
      } else {
        log.debug(text);
      }
     
      PropertyResolver propertyResolver = wordMLPackage.getMainDocumentPart().getPropertyResolver();
     
//      Style pStyle = null;
      String pStyleId = null;
      RPr pRPr = null;
      if (pPr==null || pPr.getPStyle()==null) {
//        pStyle = getDefaultPStyle();
        if (getDefaultPStyle() == null) {
          log.warn("getDefaultPStyle() returned null");
        } else {
//            log.debug("using default p style");
//            pRPr = pStyle.getRPr();  // TODO pStyle.getRPr() should inherit from basedOn
            pStyleId = getDefaultPStyle().getStyleId();
        }
      } else {
        pStyleId = pPr.getPStyle().getVal();
      }
       
      if (pStyleId!=null && wordMLPackage.getMainDocumentPart().getStyleDefinitionsPart(false) != null) {
        // apply the rPr in the stack of styles, including documentDefaultRPr
//        log.debug(pStyleId);
        pRPr = propertyResolver.getEffectiveRPr(pStyleId);
//          log.debug("before getEffectiveRPrUsingPStyleRPr\n" + XmlUtils.marshaltoString(pRPr));
      }

      // Do we need boolean major??
      // Can work that out from pStyle

     
      // now apply the direct rPr
      rPr = propertyResolver.getEffectiveRPrUsingPStyleRPr(rPr, pRPr);
      // TODO use effective rPr, but don't inherit theme val,
      // TODO, add cache?
     
      log.debug("effective\n" + XmlUtils.marshaltoString(rPr));
     
View Full Code Here

TOP

Related Classes of org.docx4j.model.PropertyResolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.