Changeset 1741


Ignore:
Timestamp:
01/05/12 03:06:51 (5 months ago)
Author:
jharrop
Message:

Add element name="compatSetting" and type="CT_CompatSetting" from ECMA-376 2ed to wml, so Word 2010 can detect docx as native

Location:
trunk/docx4j
Files:
1 added
3 edited

Legend:

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

    r1129 r1741  
    11/* 
    2  *  Copyright 2007-2008, Plutext Pty Ltd. 
     2 *  Copyright 2007-2012, Plutext Pty Ltd. 
    33 *    
    44 *  This file is part of docx4j. 
     
    2222package org.docx4j.wml; 
    2323 
     24import java.util.ArrayList; 
     25import java.util.List; 
    2426import javax.xml.bind.Unmarshaller; 
    2527import javax.xml.bind.annotation.XmlAccessType; 
     
    105107 *         <element name="useAnsiKerningPairs" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}BooleanDefaultTrue" minOccurs="0"/> 
    106108 *         <element name="cachedColBalance" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}BooleanDefaultTrue" minOccurs="0"/> 
     109 *         <element name="compatSetting" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}CT_CompatSetting" maxOccurs="unbounded" minOccurs="0"/> 
    107110 *       </sequence> 
    108111 *     </restriction> 
     
    179182    "doNotVertAlignInTxbx", 
    180183    "useAnsiKerningPairs", 
    181     "cachedColBalance" 
     184    "cachedColBalance", 
     185    "compatSetting" 
    182186}) 
    183187public class CTCompat 
     
    250254    protected BooleanDefaultTrue useAnsiKerningPairs; 
    251255    protected BooleanDefaultTrue cachedColBalance; 
     256    protected List<CTCompatSetting> compatSetting; 
    252257    @XmlTransient 
    253258    private Object parent; 
     
    18111816    public void setCachedColBalance(BooleanDefaultTrue value) { 
    18121817        this.cachedColBalance = value; 
     1818    } 
     1819 
     1820    /** 
     1821     * Gets the value of the compatSetting property. 
     1822     *  
     1823     * <p> 
     1824     * This accessor method returns a reference to the live list, 
     1825     * not a snapshot. Therefore any modification you make to the 
     1826     * returned list will be present inside the JAXB object. 
     1827     * This is why there is not a <CODE>set</CODE> method for the compatSetting property. 
     1828     *  
     1829     * <p> 
     1830     * For example, to add a new item, do as follows: 
     1831     * <pre> 
     1832     *    getCompatSetting().add(newItem); 
     1833     * </pre> 
     1834     *  
     1835     *  
     1836     * <p> 
     1837     * Objects of the following type(s) are allowed in the list 
     1838     * {@link CTCompatSetting } 
     1839     *  
     1840     *  
     1841     */ 
     1842    public List<CTCompatSetting> getCompatSetting() { 
     1843        if (compatSetting == null) { 
     1844            compatSetting = new ArrayList<CTCompatSetting>(); 
     1845        } 
     1846        return this.compatSetting; 
    18131847    } 
    18141848 
  • trunk/docx4j/src/main/java/org/docx4j/wml/ObjectFactory.java

    r1471 r1741  
    343343        return new CTCompat(); 
    344344    } 
     345     
     346    /** 
     347     * Create an instance of {@link CTCompatSetting } 
     348     *  
     349     */ 
     350    public CTCompatSetting createCTCompatSetting() { 
     351        return new CTCompatSetting(); 
     352    }     
    345353 
    346354    /** 
  • trunk/docx4j/xsd/wml/wml.xsd

    r1664 r1741  
    2626 
    272720091010 - oops, added EG_MathContent back into EG_RunElements 
     28 
     2920120105 - add element name="compatSetting" and type="CT_CompatSetting" from 2ed, so Word 2010 can detect docx as native  
    2830         
    2931USAGE INSTRUCTIONS 
     
    3537  And the parent-pointer-plugin.  See http://fisheye5.cenqua.com/browse/jaxb2-commons/parent-pointer-plugin 
    3638         
    37   We have a copy of this in the lib dir.  Or you can build it yourself: 
     39  We have a copy of this in thealib dir.  Or you can build it yourself: 
    3840         
    3941        cvs -d :pserver:$DEV_JAVA_NET_USERNAME@cvs.dev.java.net:/cvs checkout -P jaxb2-commons 
     
    6870  ) 
    6971   
     72  Windows: 
     73   
     74     C:>\Java\jaxb-ri-20110601\bin\xjc.bat -classpath \Java\parent-pointer-plugin-1.0.jar -Xparent-pointer wml.xsd -d t2 -no-header -target 2.0 
    7075   
    7176         
     
    1059010595                                </xsd:annotation> 
    1059110596                        </xsd:element> 
     10597                        <xsd:element name="compatSetting" type="CT_CompatSetting" minOccurs="0" maxOccurs="unbounded"> 
     10598                                <!--  Added from 3ed for docx4j 2.7.2, so native Word 2010 docx can be produced --> 
     10599                                <xsd:annotation> 
     10600                                        <xsd:documentation>Custom Compatibility Setting</xsd:documentation> 
     10601                                </xsd:annotation>                        
     10602                        </xsd:element> 
    1059210603                </xsd:sequence> 
    1059310604        </xsd:complexType> 
     10605        <xsd:complexType name="CT_CompatSetting"> 
     10606                <xsd:attribute name="name" type="ST_String"> 
     10607                        <xsd:annotation> 
     10608                                <xsd:documentation>Name of Setting</xsd:documentation> 
     10609                        </xsd:annotation> 
     10610                </xsd:attribute> 
     10611                <xsd:attribute name="uri" type="ST_String"> 
     10612                        <xsd:annotation> 
     10613                                <xsd:documentation>Namespace of Setting</xsd:documentation> 
     10614                        </xsd:annotation> 
     10615                </xsd:attribute> 
     10616                <xsd:attribute name="val" type="ST_String"> 
     10617                        <xsd:annotation> 
     10618                                <xsd:documentation>Value of Setting</xsd:documentation> 
     10619                        </xsd:annotation> 
     10620                </xsd:attribute> 
     10621        </xsd:complexType>       
    1059410622        <xsd:complexType name="CT_DocVar"> 
    1059510623                <xsd:attribute name="name" type="ST_String" use="required"> 
Note: See TracChangeset for help on using the changeset viewer.