Ignore:
Timestamp:
02/27/10 06:52:46 (2 years ago)
Author:
jharrop
Message:

Moved jcPML to org.pptx4j.jaxb.Context

Don't assume default paragraph,character styles are Normal,Default.. respectively.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/docx4j/src/main/java/org/docx4j/model/styles/StyleTree.java

    r1029 r1096  
    6060         * @param allStyles styles defined in the style definitions part 
    6161         */ 
    62         public StyleTree(List<String> stylesInUse, Map<String, Style> allStyles) { 
     62        public StyleTree(List<String> stylesInUse, Map<String, Style> allStyles, 
     63                        String defaultParagraphStyleId, String defaultCharacterStyleId) { 
     64                 
    6365                 
    6466                // Set up Table style tree  
     
    8284                // Set up Paragraph style tree  
    8385        // but first, add Normal.  (Doesn't matter if its already there) 
    84                 stylesInUse.add("Normal"); 
     86                stylesInUse.add(defaultParagraphStyleId); 
    8587        for (String styleId : stylesInUse ) { 
    8688                if (pTree.get(styleId)==null) { 
     
    102104                // Set up Character style tree  
    103105        // but first, add DefaultParagraphFont.  (Doesn't matter if its already there) 
    104                 stylesInUse.add("DefaultParagraphFont"); 
     106                stylesInUse.add(defaultCharacterStyleId); 
    105107        for (String styleId : stylesInUse ) { 
    106108                if (cTree.get(styleId)==null) { 
     
    196198                } 
    197199         
    198                 StyleTree st = new StyleTree(stylesInUse, allStyles); 
     200                StyleTree st = new StyleTree(stylesInUse, allStyles, 
     201                                wmlPackage.getMainDocumentPart().getStyleDefinitionsPart().getDefaultParagraphStyle().getStyleId(), 
     202                                wmlPackage.getMainDocumentPart().getStyleDefinitionsPart().getDefaultCharacterStyle().getStyleId()); 
    199203                 
    200204                System.out.println("\nParagraph styles\n"); 
Note: See TracChangeset for help on using the changeset viewer.