diff options
author | Rainer Klute <klute@apache.org> | 2004-08-15 15:20:08 +0000 |
---|---|---|
committer | Rainer Klute <klute@apache.org> | 2004-08-15 15:20:08 +0000 |
commit | 68b95f3a3fda2a484ea0ded1d083676704703c68 (patch) | |
tree | b7bc2c3a9b0107def3b89981ce6989a821339c34 | |
parent | 14befc7fea60ad714815b35afb75105458b819e3 (diff) | |
download | poi-68b95f3a3fda2a484ea0ded1d083676704703c68.tar.gz poi-68b95f3a3fda2a484ea0ded1d083676704703c68.zip |
Some code and documentation cleanup.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353584 13f79535-47bb-0310-9956-ffa450edef68
5 files changed, 52 insertions, 23 deletions
diff --git a/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java b/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java index 01418cfaa5..21b1b2a9fe 100644 --- a/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java +++ b/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java @@ -255,11 +255,7 @@ public class DocumentSummaryInformation extends SpecialPropertySet /** - * <p>Returns <code>true</code> if the custom links are hampered - * by excessive noise, for all applications.</p> <p> - * - * <strong>FIXME (3):</strong> Explain this some more! I (Rainer) - * don't understand it.</p> + * <p>Returns <code>true</code> if the custom links are dirty.</p> <p> * * @return The linksDirty value */ diff --git a/src/java/org/apache/poi/hpsf/MutableSection.java b/src/java/org/apache/poi/hpsf/MutableSection.java index aef344aab2..f457631a14 100644 --- a/src/java/org/apache/poi/hpsf/MutableSection.java +++ b/src/java/org/apache/poi/hpsf/MutableSection.java @@ -506,7 +506,7 @@ public class MutableSection extends Section /** - * <p>Returns this section's properties.</p> + * <p>Gets this section's properties.</p> * * @return this section's properties. */ @@ -521,14 +521,13 @@ public class MutableSection extends Section /** * <p>Gets a property.</p> * - * <p><strong>FIXME (2):</strong> This method ensures that properties and - * preprops are in sync. Cleanup this awful stuff!</p> - * * @param id The ID of the property to get * @return The property or <code>null</code> if there is no such property */ public Object getProperty(final long id) { + /* Calling getProperties() ensures that properties and preprops are in + * sync.</p> */ getProperties(); return super.getProperty(id); } diff --git a/src/java/org/apache/poi/hpsf/SummaryInformation.java b/src/java/org/apache/poi/hpsf/SummaryInformation.java index ea5d734311..cd7fa00a1f 100644 --- a/src/java/org/apache/poi/hpsf/SummaryInformation.java +++ b/src/java/org/apache/poi/hpsf/SummaryInformation.java @@ -264,10 +264,9 @@ public class SummaryInformation extends SpecialPropertySet * <strong>when this method is implemented. Please note that the * return type is likely to change!</strong></p> * - * <p><strong>FIXME (3) / Hint to developers:</strong> Drew Varner - * <Drew.Varner -at- sc.edu> said that this is an image in - * WMF or Clipboard (BMP?) format. He also provided two links that - * might be helpful: <a + * <p><strong>Hint to developers:</strong> Drew Varner <Drew.Varner -at- + * sc.edu> said that this is an image in WMF or Clipboard (BMP?) format. + * He also provided two links that might be helpful: <a * href="http://www.csn.ul.ie/~caolan/publink/file/OLE2SummaryAgainst_file-3.27.patch" * target="_blank">http://www.csn.ul.ie/~caolan/publink/file/OLE2SummaryAgainst_file-3.27.patch</a> * and <a diff --git a/src/java/org/apache/poi/hpsf/wellknown/PropertyIDMap.java b/src/java/org/apache/poi/hpsf/wellknown/PropertyIDMap.java index 237339178e..77a17b5224 100644 --- a/src/java/org/apache/poi/hpsf/wellknown/PropertyIDMap.java +++ b/src/java/org/apache/poi/hpsf/wellknown/PropertyIDMap.java @@ -17,7 +17,9 @@ package org.apache.poi.hpsf.wellknown; +import java.util.Collections; import java.util.HashMap; +import java.util.Map; /** * <p>This is a dictionary which maps property ID values to property @@ -29,12 +31,8 @@ import java.util.HashMap; * should treat them as unmodifiable, copy them and modifiy the * copies.</p> * - * <p><strong>FIXME (3):</strong> Make the singletons unmodifiable. However, - * since this requires to use a {@link HashMap} delegate instead of - * extending {@link HashMap} and thus requires a lot of stupid typing, I won't - * do that for the time being.</p> - * - * @author Rainer Klute (klute@rainer-klute.de) + * @author Rainer Klute <a + * href="mailto:klute@rainer-klute.de"><klute@rainer-klute.de></a> * @version $Id$ * @since 2002-02-09 */ @@ -104,7 +102,31 @@ public class PropertyIDMap extends HashMap * document</p> */ public static final int PID_APPNAME = 18; - /** <p>FIXME (2): ID of the property that denotes...</p> */ + /** <p>ID of the property that denotes whether read/write access to the + * document is allowed or whether is should be opened as read-only. It can + * have the following values:</p> + * + * <table> + * <tbody> + * <tr> + * <th><p>Value</p></th> + * <th><p>Description</p></th> + * </tr> + * <tr> + * <th><p>0</p></th> + * <th><p>No restriction</p></th> + * </tr> + * <tr> + * <th><p>2</p></th> + * <th><p>Read-only recommended</p></th> + * </tr> + * <tr> + * <th><p>4</p></th> + * <th><p>Read-only enforced</p></th> + * </tr> + * </tbody> + * </table> + */ public static final int PID_SECURITY = 19; @@ -243,6 +265,18 @@ public class PropertyIDMap extends HashMap /** + * <p>Creates a {@link PropertyIDMap} backed by another map.</p> + * + * @param map The instance to be created is backed by this map. + */ + public PropertyIDMap(final Map map) + { + super(map); + } + + + + /** * <p>Puts a ID string for an ID into the {@link * PropertyIDMap}.</p> * @@ -300,7 +334,8 @@ public class PropertyIDMap extends HashMap m.put(PID_THUMBNAIL, "PID_THUMBNAIL"); m.put(PID_APPNAME, "PID_APPNAME"); m.put(PID_SECURITY, "PID_SECURITY"); - summaryInformationProperties = m; + summaryInformationProperties = + new PropertyIDMap(Collections.unmodifiableMap(m)); } return summaryInformationProperties; } @@ -335,7 +370,8 @@ public class PropertyIDMap extends HashMap m.put(PID_MANAGER, "PID_MANAGER"); m.put(PID_COMPANY, "PID_COMPANY"); m.put(PID_LINKSDIRTY, "PID_LINKSDIRTY"); - documentSummaryInformationProperties = m; + documentSummaryInformationProperties = + new PropertyIDMap(Collections.unmodifiableMap(m)); } return documentSummaryInformationProperties; } diff --git a/src/testcases/org/apache/poi/hpsf/basic/TestWrite.java b/src/testcases/org/apache/poi/hpsf/basic/TestWrite.java index 6c0e97a740..1e1eada3a1 100644 --- a/src/testcases/org/apache/poi/hpsf/basic/TestWrite.java +++ b/src/testcases/org/apache/poi/hpsf/basic/TestWrite.java @@ -29,7 +29,6 @@ import java.io.OutputStream; import java.io.PrintWriter; import java.io.StringWriter; import java.io.UnsupportedEncodingException; -import java.util.Arrays; import java.util.Date; import java.util.HashMap; import java.util.Map; |