* @see SummaryInformation
*
* @author Rainer Klute (klute@rainer-klute.de)
+ * @author Drew Varner (Drew.Varner closeTo sc.edu)
+ *
* @version $Id$
* @since 2002-02-09
*/
/**
- * <p>Returns the stream's scale (or <code>null</code>)
- * <strong>when this method is implemented. Please note that the
- * return type is likely to change!</strong>
+ * <p>Returns <code>true</code> when scaling of the thumbnail is
+ * desired, <code>false</code> if cropping is desired.</p>
*/
public boolean getScale()
{
- if (true)
- throw new UnsupportedOperationException("FIXME");
- // return (byte[]) getProperty(PropertyIDMap.PID_SCALE);
- return false;
+ return getPropertyBooleanValue(PropertyIDMap.PID_SCALE);
}
/**
- * <p>Returns the stream's links dirty information <strong>when
- * this method is implemented.</strong>
+ * <p>Returns <code>true</code> if the custom links are hampered
+ * by excessive noise, for all applications.</p>
+ *
+ * <p><strong>FIXME:</strong> Explain this some more! I (Rainer)
+ * don't understand it.</p>
*/
public boolean getLinksDirty()
{
- if (true)
- throw new UnsupportedOperationException("FIXME");
- // return (byte[]) getProperty(PropertyIDMap.PID_LINKSDIRTY);
- return false;
+ return getPropertyBooleanValue(PropertyIDMap.PID_LINKSDIRTY);
}
}
*
* @author Rainer Klute (klute@rainer-klute.de)
* @author Drew Varner (Drew.Varner InAndAround sc.edu)
+ *
* @version $Id$
* @since 2002-02-09
*/
}
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];
* Section}).
*
* @author Rainer Klute (klute@rainer-klute.de)
+ * @author Drew Varner (Drew.Varner hanginIn sc.edu)
+ *
* @version $Id$
* @since 2002-02-09
*/
+ /**
+ * <p>Convenience method returning the value of a boolean property
+ * with the specified ID. If the property is not available,
+ * <code>false</code> is returned. A subsequent call to {@link
+ * #wasNull} will return <code>true</code> to let the caller
+ * distinguish that case from a real property value of
+ * <code>false</code>.</p>
+ *
+ * @throws NoSingleSectionException if the {@link PropertySet} has
+ * more or less than one {@link Section}.
+ */
+ protected boolean getPropertyBooleanValue(final int id)
+ throws NoSingleSectionException
+ {
+ return getSingleSection().getPropertyBooleanValue(id);
+ }
+
+
+
/**
* <p>Convenience method returning the value of the numeric
* property with the specified ID. If the property is not
* <p>Represents a section in a {@link PropertySet}.</p>
*
* @author Rainer Klute (klute@rainer-klute.de)
+ * @author Drew Varner (Drew.Varner allUpIn sc.edu)
+ *
* @version $Id$
* @since 2002-02-09
*/
+ /**
+ * <p>Returns the value of the boolean property with the specified
+ * ID. If the property is not available, <code>false</code> is
+ * returned. A subsequent call to {@link #wasNull} will return
+ * <code>true</code> to let the caller distinguish that case from
+ * a real property value of <code>false</code>.</p>
+ */
+ protected boolean getPropertyBooleanValue(final int id)
+ {
+ final Boolean b = (Boolean) getProperty(id);
+ if (b != null)
+ return b.booleanValue();
+ else
+ return false;
+ }
+
+
+
private boolean wasNull;
/**
package org.apache.poi.hpsf.littleendian;
/**
- * <p>Represents a double word (4 bytes).</p>
+ * <p>Represents an unsigned double word (4 bytes).</p>
*
* @author Rainer Klute (klute@rainer-klute.de)
* @version $Id$
/**
- * <p>Return the integral value of this {@link DWord}.</p>
+ * <p>Returns the integral value of this {@link DWord}.</p>
*
* <p><strong>FIXME:</strong> Introduce a superclass for the
* numeric types and make this a method of the superclass!</p>