Changeset 1463


Ignore:
Timestamp:
04/03/11 07:27:03 (14 months ago)
Author:
jharrop
Message:

Changes consequent on fresh VML classes.

Location:
trunk/docx4j/src/main/java/org/docx4j
Files:
8 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/docx4j/src/main/java/org/docx4j/TraversalUtil.java

    r1453 r1463  
    44import java.util.ArrayList; 
    55import java.util.List; 
     6 
     7import javax.xml.bind.JAXBElement; 
    68 
    79import org.apache.log4j.Logger; 
     
    190192                        return ((Pict)o).getAnyAndAny(); // (why didn't the reflection below find this?) 
    191193                } else if (o instanceof org.docx4j.vml.CTShape) {                                
    192                         return ((org.docx4j.vml.CTShape)o).getAny(); 
     194//                      return ((org.docx4j.vml.CTShape)o).getAny(); 
     195                        List<Object> artificialList = new ArrayList<Object>(); 
     196                        for (JAXBElement<?> j : ((org.docx4j.vml.CTShape)o).getPathOrFormulasOrHandles() ) { 
     197                                artificialList.add(j);                           
     198                        } 
     199                        return artificialList; 
    193200                } else if (o instanceof org.docx4j.vml.CTTextbox) {                              
    194                         return ((org.docx4j.vml.CTTextbox)o).getAny(); 
    195                 } else if (o instanceof org.docx4j.wml.CTTxbxContent) {                          
    196                         return ((org.docx4j.wml.CTTxbxContent)o).getEGBlockLevelElts(); 
     201//                      return ((org.docx4j.vml.CTTextbox)o).getAny(); 
     202                        return ((org.docx4j.vml.CTTextbox)o).getTxbxContent().getEGBlockLevelElts(); 
     203                                // grandchildren 
     204 
     205//              } else if (o instanceof org.docx4j.wml.CTTxbxContent) {                          
     206//                      return ((org.docx4j.wml.CTTxbxContent)o).getEGBlockLevelElts(); 
    197207                } else if (o instanceof CTObject) { 
    198208                        return ((CTObject)o).getAnyAndAny(); 
  • trunk/docx4j/src/main/java/org/docx4j/model/images/WordXmlPictureE10.java

    r1138 r1463  
    140140        private void findImageData() { 
    141141                 
    142         if (shape.getAny()==null) { 
     142        if (shape.getPathOrFormulasOrHandles()==null) { 
    143143                log.debug("Shape had no any: " + XmlUtils.marshaltoString(shape, true)); 
    144144        } else { 
    145                 for (Object o : shape.getAny() ) { 
     145                for (Object o : shape.getPathOrFormulasOrHandles() ) { 
    146146                        if (o instanceof JAXBElement ) { 
    147147                                JAXBElement jb = (JAXBElement)o; 
     
    187187        } 
    188188         
    189         String imgRelId = converter.imageData.getOtherAttributes().get( 
    190                         new QName("http://schemas.openxmlformats.org/officeDocument/2006/relationships", "id"));    
    191                 //NB r:id is not given by getId()! 
     189//        String imgRelId = converter.imageData.getOtherAttributes().get( 
     190//                      new QName("http://schemas.openxmlformats.org/officeDocument/2006/relationships", "id"));    
     191         
     192        String imgRelId = converter.imageData.getId(); 
    192193        if (imgRelId!=null && !imgRelId.equals("")) { 
    193194                log.debug("Handling " + imgRelId); 
     
    344345         
    345346    private void readStandardAttributes(CTShape shape) { 
    346         this.id = shape.getId(); 
     347//        this.id = shape.getId(); 
     348        this.id = shape.getVmlId(); 
     349         
    347350        this.pType = shape.getType();  
    348351        this.alt = shape.getAlt(); 
Note: See TracChangeset for help on using the changeset viewer.