diff --git a/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java b/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java index 0dacd0d97c..a62c21c8ec 100644 --- a/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java +++ b/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java @@ -556,8 +556,249 @@ public class DocumentSummaryInformation extends SpecialPropertySet final MutableSection s = (MutableSection) getFirstSection(); s.removeProperty(PropertyIDMap.PID_LINKSDIRTY); } + + + /** + *
Returns the character count including whitespace, or 0 if the + * {@link DocumentSummaryInformation} does not contain this char count.
+ *This is the whitespace-including version of {@link SummaryInformation#getCharCount()}
+ *
+ * @return The character count or null
+ */
+ public int getCharCountWithSpaces()
+ {
+ return getPropertyIntValue(PropertyIDMap.PID_CCHWITHSPACES);
+ }
+ /**
+ * Sets the character count including whitespace
+ *
+ * @param charCount The character count to set.
+ */
+ public void setCharCountWithSpaces(int count)
+ {
+ final MutableSection s = (MutableSection) getFirstSection();
+ s.setProperty(PropertyIDMap.PID_CCHWITHSPACES, count);
+ }
+
+ /**
+ * Removes the character count
+ */
+ public void removeCharCountWithSpaces()
+ {
+ final MutableSection s = (MutableSection) getFirstSection();
+ s.removeProperty(PropertyIDMap.PID_CCHWITHSPACES);
+ }
+
+
+ /**
+ *
Get if the User Defined Property Set has been updated outside of the + * Application.
+ *If it has (true), the hyperlinks should be updated on document load.
+ */ + public boolean getHyperlinksChanged() + { + return getPropertyBooleanValue(PropertyIDMap.PID_HYPERLINKSCHANGED); + } + + /** + * Set the flag for if the User Defined Property Set has been updated outside + * of the Application. + */ + public void setHyperlinksChanged(boolean changed) + { + final MutableSection s = (MutableSection) getFirstSection(); + s.setProperty(PropertyIDMap.PID_HYPERLINKSCHANGED, changed); + } + + /** + * Removes the flag for if the User Defined Property Set has been updated + * outside of the Application. + */ + public void removeHyperlinksChanged() + { + final MutableSection s = (MutableSection) getFirstSection(); + s.removeProperty(PropertyIDMap.PID_HYPERLINKSCHANGED); + } + + /** + *Gets the version of the Application which wrote the + * Property set, stored with the two high order bytes having the major + * version number, and the two low order bytes the minor version number.
+ *This will be 0 if no version is set.
+ */ + public int getApplicationVersion() + { + return getPropertyIntValue(PropertyIDMap.PID_VERSION); + } + + /** + * Sets the Application version, which must be a 4 byte int with + * the two high order bytes having the major version number, and the + * two low order bytes the minor version number. + */ + public void setApplicationVersion(int version) + { + final MutableSection s = (MutableSection) getFirstSection(); + s.setProperty(PropertyIDMap.PID_VERSION, version); + } + + /** + * Removes the Application Version + */ + public void removeApplicationVersion() + { + final MutableSection s = (MutableSection) getFirstSection(); + s.removeProperty(PropertyIDMap.PID_VERSION); + } + + + /** + *Returns the VBA digital signature for the VBA project
+ * embedded in the document (or null
).
Sets the VBA digital signature for the VBA project + * embedded in the document.
+ * + * @param signature VBA Digital Signature for the project + */ + public void setVBADigitalSignature(byte[] signature) + { + final MutableSection s = (MutableSection) getFirstSection(); + s.setProperty(PropertyIDMap.PID_DIGSIG, signature); + } + + /** + * Removes the VBA Digital Signature + */ + public void removeVBADigitalSignature() + { + final MutableSection s = (MutableSection) getFirstSection(); + s.removeProperty(PropertyIDMap.PID_DIGSIG); + } + + + /** + *Gets the content type of the file (or null
).
Gets the content status of the file (or null
).
Gets the document language, which is normally unset and empty
+ * (or null
).
Gets the document version as a string, which is normally unset and empty
+ * (or null
).
Gets the custom properties.
* diff --git a/src/java/org/apache/poi/hpsf/wellknown/PropertyIDMap.java b/src/java/org/apache/poi/hpsf/wellknown/PropertyIDMap.java index 7d7502b810..72f09ff112 100644 --- a/src/java/org/apache/poi/hpsf/wellknown/PropertyIDMap.java +++ b/src/java/org/apache/poi/hpsf/wellknown/PropertyIDMap.java @@ -250,7 +250,7 @@ public class PropertyIDMap extends HashMapThis entry contains the version of the Application which wrote the * Property set, stored with the two high order bytes having the major - * version number, and hte two low order bytes the minor version number. + * version number, and the two low order bytes the minor version number. */ public static final int PID_VERSION = 0x17;