diff --git a/src/main/java/org/docx4j/convert/out/ConversionSectionWrapper.java b/src/main/java/org/docx4j/convert/out/ConversionSectionWrapper.java index 618e35b9fc..006fafe61a 100644 --- a/src/main/java/org/docx4j/convert/out/ConversionSectionWrapper.java +++ b/src/main/java/org/docx4j/convert/out/ConversionSectionWrapper.java @@ -28,6 +28,10 @@ import org.docx4j.wml.BooleanDefaultTrue; import org.docx4j.wml.SectPr; +/** + * corresponds to a section in the xslt (ie excludes continuous sections). + * + */ public class ConversionSectionWrapper extends SectionWrapper { protected List content = null; protected String id = null; diff --git a/src/main/java/org/docx4j/model/fields/FldSimpleModel.java b/src/main/java/org/docx4j/model/fields/FldSimpleModel.java index c716877fc5..49e5b29d07 100644 --- a/src/main/java/org/docx4j/model/fields/FldSimpleModel.java +++ b/src/main/java/org/docx4j/model/fields/FldSimpleModel.java @@ -74,6 +74,7 @@ protected void setupNameParameterString(String text) { } public static List splitParameters(String text) { + log.debug("splitParameters: " + text); List ret = Collections.EMPTY_LIST; int valStart = -1; diff --git a/src/main/java/org/docx4j/model/images/AbstractConversionImageHandler.java b/src/main/java/org/docx4j/model/images/AbstractConversionImageHandler.java index 1e369ac011..4f7bc8f624 100644 --- a/src/main/java/org/docx4j/model/images/AbstractConversionImageHandler.java +++ b/src/main/java/org/docx4j/model/images/AbstractConversionImageHandler.java @@ -18,7 +18,7 @@ public abstract class AbstractConversionImageHandler implements ConversionImageH protected static Logger log = LoggerFactory.getLogger(AbstractConversionImageHandler.class); protected String uuid = UUID.randomUUID().toString(); protected Map handledImagesMap = new TreeMap(); - protected String imageDirPath = null; + protected String imageDirPath = null; // TODO FIXME should not be here; move to FileConversionImageHandler protected boolean includeUUID = true; /** Creates an AbstractConversionImageHandler diff --git a/src/main/java/org/docx4j/model/properties/run/AbstractRunProperty.java b/src/main/java/org/docx4j/model/properties/run/AbstractRunProperty.java index b0b9a73792..f84c03d7b8 100644 --- a/src/main/java/org/docx4j/model/properties/run/AbstractRunProperty.java +++ b/src/main/java/org/docx4j/model/properties/run/AbstractRunProperty.java @@ -27,6 +27,6 @@ public abstract class AbstractRunProperty extends Property { public abstract void set(RPr rPr); - public abstract void set(CTTextCharacterProperties rPr); + public abstract void set(CTTextCharacterProperties rPr); // DrawingML } diff --git a/src/main/java/org/docx4j/openpackaging/io3/stores/PartStore.java b/src/main/java/org/docx4j/openpackaging/io3/stores/PartStore.java index ca8b819996..47eaa6952e 100644 --- a/src/main/java/org/docx4j/openpackaging/io3/stores/PartStore.java +++ b/src/main/java/org/docx4j/openpackaging/io3/stores/PartStore.java @@ -83,7 +83,14 @@ public interface PartStore { */ public long getPartSize(String partName) throws Docx4JException, java.lang.UnsupportedOperationException; -// public void finishLoad() throws Docx4JException; + /* + * If the implementation closes resources here, + * loadPart, if subsequently called, will need a way to re-open + * them. So its better just to have a notion of package unload, + * at which time resources are closed. + * + * public void finishLoad() throws Docx4JException; + */ public void setOutputStream(OutputStream os) throws Docx4JException; diff --git a/src/main/java/org/docx4j/openpackaging/io3/stores/UnzippedPartStore.java b/src/main/java/org/docx4j/openpackaging/io3/stores/UnzippedPartStore.java index a89dbfbf15..47db592149 100644 --- a/src/main/java/org/docx4j/openpackaging/io3/stores/UnzippedPartStore.java +++ b/src/main/java/org/docx4j/openpackaging/io3/stores/UnzippedPartStore.java @@ -133,7 +133,6 @@ public long getPartSize(String partName) throws Docx4JException { } } - ///// Save methods diff --git a/src/main/java/org/docx4j/openpackaging/io3/stores/ZipPartStore.java b/src/main/java/org/docx4j/openpackaging/io3/stores/ZipPartStore.java index 2a8e3589b6..51500c7013 100644 --- a/src/main/java/org/docx4j/openpackaging/io3/stores/ZipPartStore.java +++ b/src/main/java/org/docx4j/openpackaging/io3/stores/ZipPartStore.java @@ -174,7 +174,7 @@ public InputStream loadPart(String partName) throws Docx4JException { ByteArray bytes = partByteArrays.get(partName); if (bytes == null) { - log.debug("part '" + partName + "' not present in part store"); + log.warn("part '" + partName + "' not present in part store"); return null; //throw new Docx4JException("part '" + partName + "' not found"); } @@ -191,7 +191,6 @@ public long getPartSize(String partName) throws Docx4JException { return bytes.getLength(); } - ///// Save methods diff --git a/src/main/java/org/docx4j/openpackaging/parts/WordprocessingML/BinaryPart.java b/src/main/java/org/docx4j/openpackaging/parts/WordprocessingML/BinaryPart.java index d65e7c0e80..ebf3068f42 100644 --- a/src/main/java/org/docx4j/openpackaging/parts/WordprocessingML/BinaryPart.java +++ b/src/main/java/org/docx4j/openpackaging/parts/WordprocessingML/BinaryPart.java @@ -141,8 +141,7 @@ public ByteBuffer getBuffer() { partStore.getPartSize( name.substring(1))); } catch (UnsupportedOperationException uoe) {} - is = partStore.loadPart( - name.substring(1)); + is = partStore.loadPart( name.substring(1)); if (is==null) { log.warn(name + " missing from part store"); } else { diff --git a/src/main/java/org/docx4j/openpackaging/parts/WordprocessingML/StyleDefinitionsPart.java b/src/main/java/org/docx4j/openpackaging/parts/WordprocessingML/StyleDefinitionsPart.java index 8a65879e2d..e7aed9f05d 100644 --- a/src/main/java/org/docx4j/openpackaging/parts/WordprocessingML/StyleDefinitionsPart.java +++ b/src/main/java/org/docx4j/openpackaging/parts/WordprocessingML/StyleDefinitionsPart.java @@ -177,9 +177,9 @@ public static java.util.Map getKnownStyles() { return knownStyles; } - /* - * Manufacture styles from the following, so they can be used as the - * roots of our style trees. + /** + * Manufacture a paragraph style from the following, so it can be used as the + * root of our paragraph style tree. * * @@ -200,6 +200,12 @@ public static java.util.Map getKnownStyles() { BEWARE: in a table, paragraph style ppr trumps table style ppr. The effect of including w:docDefaults in the style hierarchy is that they trump table style ppr, but they should not! + + * There is no need for a doc defaults character style. + * The reason for this is that Word seems to ignore Default Paragraph Style! + * So the run formatting comes from paragraph style + explicit character style (if any), + * plus direct formatting. + */ public void createVirtualStylesForDocDefaults() throws Docx4JException { diff --git a/src/main/java/org/docx4j/samples/README.md b/src/main/java/org/docx4j/samples/README.md new file mode 100644 index 0000000000..97bed974eb --- /dev/null +++ b/src/main/java/org/docx4j/samples/README.md @@ -0,0 +1,3 @@ +For docx4j v3, the sample code has moved to: + + https://github.com/plutext/docx4j/tree/master/src/samples/docx4j/org/docx4j/samples \ No newline at end of file diff --git a/src/main/java/org/opendope/conditions/Xpathref.java b/src/main/java/org/opendope/conditions/Xpathref.java index 17625e1c1e..ae8e71bb42 100644 --- a/src/main/java/org/opendope/conditions/Xpathref.java +++ b/src/main/java/org/opendope/conditions/Xpathref.java @@ -1,4 +1,3 @@ - package org.opendope.conditions; import static org.docx4j.model.datastorage.XPathEnhancerParser.enhanceXPath; diff --git a/src/test/resources/MERGEFIELD.docx b/src/test/resources/MERGEFIELD.docx index c187ab2bd5..60cbe6a262 100644 Binary files a/src/test/resources/MERGEFIELD.docx and b/src/test/resources/MERGEFIELD.docx differ diff --git a/xsd/word2003xmlto2006.xsd b/xsd/word2003xmlto2006.xsd index 6a78d1b051..a7ac9ebe07 100644 --- a/xsd/word2003xmlto2006.xsd +++ b/xsd/word2003xmlto2006.xsd @@ -30,7 +30,6 @@ JAXB INSTRUCTIONS xjc word2003xmlto2006.xsd -d temp -no-header -target 2.0 -extension - -->