diff --git a/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java b/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java index a950c0db8d..3cc2499f79 100644 --- a/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java +++ b/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java @@ -65,6 +65,8 @@ import org.apache.poi.hpsf.wellknown.*; * @see SummaryInformation * * @author Rainer Klute (klute@rainer-klute.de) + * @author Drew Varner (Drew.Varner closeTo sc.edu) + * * @version $Id$ * @since 2002-02-09 */ @@ -191,16 +193,12 @@ public class DocumentSummaryInformation extends SpecialPropertySet /** - *
Returns the stream's scale (or null)
- * when this method is implemented. Please note that the
- * return type is likely to change!
+ *
Returns true when scaling of the thumbnail is
+ * desired, false if cropping is desired.
Returns the stream's links dirty information when - * this method is implemented. + *
Returns true if the custom links are hampered
+ * by excessive noise, for all applications.
FIXME: Explain this some more! I (Rainer) + * don't understand it.
*/ public boolean getLinksDirty() { - if (true) - throw new UnsupportedOperationException("FIXME"); - // return (byte[]) getProperty(PropertyIDMap.PID_LINKSDIRTY); - return false; + return getPropertyBooleanValue(PropertyIDMap.PID_LINKSDIRTY); } } diff --git a/src/java/org/apache/poi/hpsf/Property.java b/src/java/org/apache/poi/hpsf/Property.java index 2826558028..9432603839 100644 --- a/src/java/org/apache/poi/hpsf/Property.java +++ b/src/java/org/apache/poi/hpsf/Property.java @@ -90,6 +90,7 @@ import org.apache.poi.hpsf.littleendian.*; * * @author Rainer Klute (klute@rainer-klute.de) * @author Drew Varner (Drew.Varner InAndAround sc.edu) + * * @version $Id$ * @since 2002-02-09 */ @@ -207,21 +208,45 @@ public class Property } case Variant.VT_CF: { - // the first four bytes in src, from - // src[offset] to src[offset + 3] contain - // the DWord for VT_CF, so skip it, we don't - // need it + /* The first four bytes in src, from rc[offset] to + * src[offset + 3] contain the DWord for VT_CF, so + * skip it, we don't need it. */ - // truncate the length of the return array by - // a DWord length (4 bytes) + /* Truncate the length of the return array by a DWord + * length (4 bytes). */ length = length - DWord.LENGTH; final byte[] v = new byte[length]; for (int i = 0; i < length; i++) - v[i] = src[offset + i + DWord.LENGTH]; + v[i] = src[o + i]; value = v; break; } + case Variant.VT_BOOL: + { + /* The first four bytes in src, from src[offset] to + * src[offset + 3] contain the DWord for VT_BOOL, so + * skip it, we don't need it. */ + final int first = o + DWord.LENGTH; + DWord bool = new DWord(src,o); + if (bool.intValue() == -1) + { + value = new Boolean(true); + } + else if (bool.intValue() == 0) + { + value = new Boolean(false); + } + else + /* FIXME: Someone might invent a new + * HPSFRuntimeException subclass + * IllegalPropertySetDataException for this and + * similar cases. */ + throw new HPSFRuntimeException + ("Illegal property set data: A boolean must be " + + "either -1 (true) or 0 (false)."); + break; + } default: { final byte[] v = new byte[length]; diff --git a/src/java/org/apache/poi/hpsf/PropertySet.java b/src/java/org/apache/poi/hpsf/PropertySet.java index b328993298..0ac0e37835 100644 --- a/src/java/org/apache/poi/hpsf/PropertySet.java +++ b/src/java/org/apache/poi/hpsf/PropertySet.java @@ -91,6 +91,8 @@ import org.apache.poi.poifs.filesystem.*; * Section}). * * @author Rainer Klute (klute@rainer-klute.de) + * @author Drew Varner (Drew.Varner hanginIn sc.edu) + * * @version $Id$ * @since 2002-02-09 */ @@ -465,6 +467,25 @@ public class PropertySet + /** + *Convenience method returning the value of a boolean property
+ * with the specified ID. If the property is not available,
+ * false is returned. A subsequent call to {@link
+ * #wasNull} will return true to let the caller
+ * distinguish that case from a real property value of
+ * false.
Convenience method returning the value of the numeric * property with the specified ID. If the property is not diff --git a/src/java/org/apache/poi/hpsf/Section.java b/src/java/org/apache/poi/hpsf/Section.java index cc0c68230a..03072bfd05 100644 --- a/src/java/org/apache/poi/hpsf/Section.java +++ b/src/java/org/apache/poi/hpsf/Section.java @@ -62,6 +62,8 @@ import org.apache.poi.hpsf.wellknown.*; *
Represents a section in a {@link PropertySet}.
* * @author Rainer Klute (klute@rainer-klute.de) + * @author Drew Varner (Drew.Varner allUpIn sc.edu) + * * @version $Id$ * @since 2002-02-09 */ @@ -231,6 +233,24 @@ public class Section + /** + *Returns the value of the boolean property with the specified
+ * ID. If the property is not available, false is
+ * returned. A subsequent call to {@link #wasNull} will return
+ * true to let the caller distinguish that case from
+ * a real property value of false.
Represents a double word (4 bytes).
+ *Represents an unsigned double word (4 bytes).
* * @author Rainer Klute (klute@rainer-klute.de) * @version $Id$ @@ -97,7 +97,7 @@ public class DWord extends LittleEndian /** - *Return the integral value of this {@link DWord}.
+ *Returns the integral value of this {@link DWord}.
* *FIXME: Introduce a superclass for the * numeric types and make this a method of the superclass!