- Timestamp:
- 08/13/10 09:44:39 (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/docx4j/src/main/java/org/docx4j/convert/out/pdf/viaXSLFO/Conversion.java
r1182 r1185 100 100 101 101 public static final String PART_TRACKER = "partTracker"; 102 public static final String FIELD_TRACKER = "fieldTracker"; // are we in a field or not? 102 103 103 104 public Conversion(WordprocessingMLPackage wordMLPackage) { … … 313 314 modelStates.put("endnoteNumber", new EndnoteState() ); 314 315 modelStates.put(PART_TRACKER, new PartTracker() ); 316 modelStates.put(FIELD_TRACKER, new InField() ); 315 317 316 318 Converter.getInstance().start(wordMLPackage); … … 866 868 NodeIterator childResults ) { 867 869 868 /* Support page numbering 870 /* Support page numbering. 871 * 872 * Word 2007 emits: 869 873 * 870 874 * <w:fldSimple w:instr=" PAGE \* MERGEFORMAT "> … … 889 893 890 894 could also include start at value. 895 896 * 897 * Word 2003 emits: 898 * 899 * <w:instrText xml:space="preserve">PAGE </w:instrText> 891 900 892 901 */ 893 902 894 try { 895 896 CTSimpleField field = null; 903 904 CTSimpleField field = null; 905 906 try { 907 field = (CTSimpleField)XmlUtils.unmarshal( 908 fldSimpleNodeIt.nextNode(), 909 Context.jc, 910 CTSimpleField.class); 911 } catch (JAXBException e1) { 912 e1.printStackTrace(); 913 } 914 915 String instr = field.getInstr(); 916 917 return handleField(instr, childResults); 897 918 898 try { 899 field = (CTSimpleField)XmlUtils.unmarshal( 900 fldSimpleNodeIt.nextNode(), 901 Context.jc, 902 CTSimpleField.class); 903 } catch (JAXBException e1) { 904 e1.printStackTrace(); 905 } 906 919 } 920 921 private static DocumentFragment handleField(String instr, NodeIterator childResults) { 922 923 try { 924 907 925 // Create a DOM builder and parse the fragment 908 926 DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); … … 912 930 913 931 914 String instr = field.getInstr();915 932 if ( !instr.toLowerCase().contains( "page") ) { 916 933 … … 963 980 964 981 return null; 982 983 } 984 985 public static DocumentFragment createBlockForInstrText( 986 WordprocessingMLPackage wmlPackage, 987 NodeIterator fldSimpleNodeIt, 988 NodeIterator childResults ) { 989 990 /* Support page numbering. 991 * 992 * Word 2003 emits : 993 * 994 * <w:fldChar w:fldCharType="begin"/> 995 * 996 * <w:instrText xml:space="preserve">PAGE </w:instrText> 997 998 <w:fldChar w:fldCharType="end"/> 999 */ 1000 1001 org.docx4j.wml.Text field = null; 1002 1003 try { 1004 field = 1005 (org.docx4j.wml.Text)XmlUtils.unmarshal( 1006 fldSimpleNodeIt.nextNode(), 1007 Context.jc, 1008 org.docx4j.wml.Text.class); 1009 } catch (JAXBException e1) { 1010 e1.printStackTrace(); 1011 } 1012 1013 return handleField( field.getValue(), childResults); 965 1014 966 1015 }
Note: See TracChangeset
for help on using the changeset viewer.
