From 8961539973b08af26057bc73d1ed6d6c4bcd3321 Mon Sep 17 00:00:00 2001
From: Rainer Klute
Date: Wed, 1 May 2002 09:31:52 +0000
Subject: [PATCH] Added Drew's thumbnail enhancements.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352578 13f79535-47bb-0310-9956-ffa450edef68
---
.../poi/hpsf/DocumentSummaryInformation.java | 8 -
.../org/apache/poi/hpsf/HPSFException.java | 8 -
.../apache/poi/hpsf/HPSFRuntimeException.java | 8 -
.../poi/hpsf/MarkUnsupportedException.java | 8 -
.../hpsf/NoPropertySetStreamException.java | 8 -
.../poi/hpsf/NoSingleSectionException.java | 8 -
src/java/org/apache/poi/hpsf/Property.java | 18 +
src/java/org/apache/poi/hpsf/PropertySet.java | 10 +-
.../apache/poi/hpsf/PropertySetFactory.java | 8 -
src/java/org/apache/poi/hpsf/Section.java | 8 -
.../apache/poi/hpsf/SpecialPropertySet.java | 8 -
.../apache/poi/hpsf/SummaryInformation.java | 2 -
src/java/org/apache/poi/hpsf/Thumbnail.java | 369 ++++++++++++++++++
.../UnexpectedPropertySetTypeException.java | 8 -
src/java/org/apache/poi/hpsf/Util.java | 8 -
src/java/org/apache/poi/hpsf/Variant.java | 39 +-
.../poi/hpsf/wellknown/PropertyIDMap.java | 8 -
.../poi/hpsf/wellknown/SectionIDMap.java | 8 -
18 files changed, 416 insertions(+), 126 deletions(-)
create mode 100644 src/java/org/apache/poi/hpsf/Thumbnail.java
diff --git a/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java b/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java
index 73d185340..8c3576ac7 100644
--- a/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java
+++ b/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java
@@ -50,14 +50,6 @@
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* .
-*
-* Portions of this software are based upon public domain software
-* originally written at the National Center for Supercomputing Applications,
-* University of Illinois, Urbana-Champaign.
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
*/
package org.apache.poi.hpsf;
diff --git a/src/java/org/apache/poi/hpsf/HPSFException.java b/src/java/org/apache/poi/hpsf/HPSFException.java
index 7461fef9e..2856579ac 100644
--- a/src/java/org/apache/poi/hpsf/HPSFException.java
+++ b/src/java/org/apache/poi/hpsf/HPSFException.java
@@ -50,14 +50,6 @@
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* .
-*
-* Portions of this software are based upon public domain software
-* originally written at the National Center for Supercomputing Applications,
-* University of Illinois, Urbana-Champaign.
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
*/
package org.apache.poi.hpsf;
diff --git a/src/java/org/apache/poi/hpsf/HPSFRuntimeException.java b/src/java/org/apache/poi/hpsf/HPSFRuntimeException.java
index c84b2e50f..12bce3be0 100644
--- a/src/java/org/apache/poi/hpsf/HPSFRuntimeException.java
+++ b/src/java/org/apache/poi/hpsf/HPSFRuntimeException.java
@@ -50,14 +50,6 @@
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* .
-*
-* Portions of this software are based upon public domain software
-* originally written at the National Center for Supercomputing Applications,
-* University of Illinois, Urbana-Champaign.
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
*/
package org.apache.poi.hpsf;
diff --git a/src/java/org/apache/poi/hpsf/MarkUnsupportedException.java b/src/java/org/apache/poi/hpsf/MarkUnsupportedException.java
index 7dc153e7d..9695053d0 100644
--- a/src/java/org/apache/poi/hpsf/MarkUnsupportedException.java
+++ b/src/java/org/apache/poi/hpsf/MarkUnsupportedException.java
@@ -50,14 +50,6 @@
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* .
-*
-* Portions of this software are based upon public domain software
-* originally written at the National Center for Supercomputing Applications,
-* University of Illinois, Urbana-Champaign.
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
*/
package org.apache.poi.hpsf;
diff --git a/src/java/org/apache/poi/hpsf/NoPropertySetStreamException.java b/src/java/org/apache/poi/hpsf/NoPropertySetStreamException.java
index e52b3068c..c1770897e 100644
--- a/src/java/org/apache/poi/hpsf/NoPropertySetStreamException.java
+++ b/src/java/org/apache/poi/hpsf/NoPropertySetStreamException.java
@@ -50,14 +50,6 @@
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* .
-*
-* Portions of this software are based upon public domain software
-* originally written at the National Center for Supercomputing Applications,
-* University of Illinois, Urbana-Champaign.
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
*/
package org.apache.poi.hpsf;
diff --git a/src/java/org/apache/poi/hpsf/NoSingleSectionException.java b/src/java/org/apache/poi/hpsf/NoSingleSectionException.java
index d8c37a852..7e97df7b4 100644
--- a/src/java/org/apache/poi/hpsf/NoSingleSectionException.java
+++ b/src/java/org/apache/poi/hpsf/NoSingleSectionException.java
@@ -50,14 +50,6 @@
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* .
-*
-* Portions of this software are based upon public domain software
-* originally written at the National Center for Supercomputing Applications,
-* University of Illinois, Urbana-Champaign.
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
*/
package org.apache.poi.hpsf;
diff --git a/src/java/org/apache/poi/hpsf/Property.java b/src/java/org/apache/poi/hpsf/Property.java
index 20e149fd4..282655802 100644
--- a/src/java/org/apache/poi/hpsf/Property.java
+++ b/src/java/org/apache/poi/hpsf/Property.java
@@ -89,6 +89,7 @@ import org.apache.poi.hpsf.littleendian.*;
* @see Variant
*
* @author Rainer Klute (klute@rainer-klute.de)
+ * @author Drew Varner (Drew.Varner InAndAround sc.edu)
* @version $Id$
* @since 2002-02-09
*/
@@ -204,6 +205,23 @@ public class Property
value = new String(src, first, last - first + 1);
break;
}
+ 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
+
+ // 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];
+ value = v;
+ 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 ad1a0cd00..b32899329 100644
--- a/src/java/org/apache/poi/hpsf/PropertySet.java
+++ b/src/java/org/apache/poi/hpsf/PropertySet.java
@@ -50,14 +50,6 @@
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* .
-*
-* Portions of this software are based upon public domain software
-* originally written at the National Center for Supercomputing Applications,
-* University of Illinois, Urbana-Champaign.
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
*/
package org.apache.poi.hpsf;
@@ -385,7 +377,7 @@ public class PropertySet
offset += ClassID.LENGTH;
sectionCount = new DWord(src, offset).intValue();
offset += DWord.LENGTH;
-
+
/* Read the sections, which are following the header. They
* start with an array of section descriptions. Each one
* consists of a format ID telling what the section contains
diff --git a/src/java/org/apache/poi/hpsf/PropertySetFactory.java b/src/java/org/apache/poi/hpsf/PropertySetFactory.java
index cc7a3e8bf..10da676f6 100644
--- a/src/java/org/apache/poi/hpsf/PropertySetFactory.java
+++ b/src/java/org/apache/poi/hpsf/PropertySetFactory.java
@@ -50,14 +50,6 @@
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* .
-*
-* Portions of this software are based upon public domain software
-* originally written at the National Center for Supercomputing Applications,
-* University of Illinois, Urbana-Champaign.
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
*/
package org.apache.poi.hpsf;
diff --git a/src/java/org/apache/poi/hpsf/Section.java b/src/java/org/apache/poi/hpsf/Section.java
index 39c4b11da..cc0c68230 100644
--- a/src/java/org/apache/poi/hpsf/Section.java
+++ b/src/java/org/apache/poi/hpsf/Section.java
@@ -50,14 +50,6 @@
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* .
-*
-* Portions of this software are based upon public domain software
-* originally written at the National Center for Supercomputing Applications,
-* University of Illinois, Urbana-Champaign.
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
*/
package org.apache.poi.hpsf;
diff --git a/src/java/org/apache/poi/hpsf/SpecialPropertySet.java b/src/java/org/apache/poi/hpsf/SpecialPropertySet.java
index 8044a1170..0d92e6fdb 100644
--- a/src/java/org/apache/poi/hpsf/SpecialPropertySet.java
+++ b/src/java/org/apache/poi/hpsf/SpecialPropertySet.java
@@ -50,14 +50,6 @@
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* .
-*
-* Portions of this software are based upon public domain software
-* originally written at the National Center for Supercomputing Applications,
-* University of Illinois, Urbana-Champaign.
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
*/
package org.apache.poi.hpsf;
diff --git a/src/java/org/apache/poi/hpsf/SummaryInformation.java b/src/java/org/apache/poi/hpsf/SummaryInformation.java
index 327046a6b..78402fbe5 100644
--- a/src/java/org/apache/poi/hpsf/SummaryInformation.java
+++ b/src/java/org/apache/poi/hpsf/SummaryInformation.java
@@ -276,8 +276,6 @@ public class SummaryInformation extends SpecialPropertySet
*/
public byte[] getThumbnail()
{
- if (true)
- throw new UnsupportedOperationException("FIXME");
return (byte[]) getProperty(PropertyIDMap.PID_THUMBNAIL);
}
diff --git a/src/java/org/apache/poi/hpsf/Thumbnail.java b/src/java/org/apache/poi/hpsf/Thumbnail.java
new file mode 100644
index 000000000..006d7d166
--- /dev/null
+++ b/src/java/org/apache/poi/hpsf/Thumbnail.java
@@ -0,0 +1,369 @@
+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2000 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ * if any, must include the following acknowledgment:
+ * "This product includes software developed by the
+ * Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowledgment may appear in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Apache" and "Apache Software Foundation" must
+ * not be used to endorse or promote products derived from this
+ * software without prior written permission. For written
+ * permission, please contact apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ * nor may "Apache" appear in their name, without prior written
+ * permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ * .
+ */
+
+package org.apache.poi.hpsf;
+
+import org.apache.poi.hpsf.littleendian.DWord;
+/**
+ * Class to manipulate data in the Clipboard Variant
+ * ({@link Variant#VT_CF VT_CF}) format.
+ *
+ * @see SummaryInformation#getThumbnail()
+ *
+ * @author Drew Varner (Drew.Varner inOrAround sc.edu)
+ * @version $Id$
+ * @since 2002-04-29
+ */
+public class Thumbnail
+{
+
+
+
+ /**
+ * Offset in bytes where the Clipboard Format Tag
+ * starts in the byte[]
returned by
+ * {@link SummaryInformation#getThumbnail()}
+ */
+ public static int OFFSET_CFTAG = 4;
+
+
+
+ /**
+ * Offset in bytes where the Clipboard Format
+ * starts in the byte[]
returned by
+ * {@link SummaryInformation#getThumbnail()}
+ *
+ * This is only valid if the Clipboard Format Tag
+ * is {@link #CFTAG_WINDOWS}
+ */
+ public static int OFFSET_CF = 8;
+
+
+
+ /**
+ * Offset in bytes where the Windows Metafile
+ * (WMF) image data starts in the byte[]
+ * returned by {@link SummaryInformation#getThumbnail()}
+ *
+ * There is only WMF data at this point in the
+ * byte[]
if the Clipboard Format Tag is
+ * {@link #CFTAG_WINDOWS} and the Clipboard Format is
+ * {@link #CF_METAFILEPICT}.
+ *
+ * Note: The byte[]
that starts at
+ * OFFSET_WMFDATA
and ends at
+ * getThumbnail().length - 1
forms a
+ * complete WMF image. It can be saved to disk with a
+ * .wmf
file type and read using a WMF-capable
+ * image viewer.
+ */
+ public static int OFFSET_WMFDATA = 20;
+
+
+
+ /**
+ * Clipboard Format Tag - Windows clipboard format
+ * A DWORD
indicating a built-in Windows clipboard
+ * format value
+ *
+ * See:
+ *
+ * http://msdn.microsoft.com/library/en-us/dnolegen/html/msdn_propset.asp
+ */
+ public static int CFTAG_WINDOWS = -1;
+
+
+
+ /**
+ *
Clipboard Format Tag - Macintosh clipboard format
+ * A DWORD
indicating a Macintosh clipboard format value
+ *
+ * See:
+ *
+ * http://msdn.microsoft.com/library/en-us/dnolegen/html/msdn_propset.asp
+ */
+ public static int CFTAG_MACINTOSH = -2;
+
+
+
+ /**
+ *
Clipboard Format Tag - Format ID
+ * A GUID containing a format identifier (FMTID). This is rarely used.
+ *
+ * See:
+ *
+ * http://msdn.microsoft.com/library/en-us/dnolegen/html/msdn_propset.asp
+ */
+ public static int CFTAG_FMTID = -3;
+
+
+
+ /**
+ *
Clipboard Format Tag - No Data
+ * a DWORD
indicating No data. This is rarely used.
+ *
+ * See:
+ *
+ * http://msdn.microsoft.com/library/en-us/dnolegen/html/msdn_propset.asp
+ */
+ public static int CFTAG_NODATA = 0;
+
+
+
+ /**
+ *
Clipboard Format - Windows metafile format.
+ * This is the recommended way to store thumbnails
+ * in Property Streams.
+ * Note: this is not the same
+ * format used in regular WMF images. The clipboard
+ * version of this format has an extra clipboard-specific
+ * header
+ */
+ public static int CF_METAFILEPICT = 3;
+
+
+
+ /**
+ * Clipboard Format - Device Independent Bitmap
+ */
+ public static int CF_DIB = 8;
+
+
+
+ /**
+ * Clipboard Format - Enhanced Windows metafile format
+ */
+ public static int CF_ENHMETAFILE = 14;
+
+
+
+ /**
+ * Clipboard Format - Bitmap
+ * Obsolete, See:
+ *
+ * msdn.microsoft.com/library/en-us/dnw98bk/html/clipboardoperations.asp
+ *
+ *
+ */
+ public static int CF_BITMAP = 2;
+
+
+
+ /**
+ * A byte[]
to hold a thumbnail image in
+ * ({@link Variant#VT_CF VT_CF}) format.
+ */
+ private byte[] thumbnailData = null;
+
+
+
+ /**
+ * Default Constructor. If you use then one you'll have to add
+ * the thumbnail byte[]
from {@link
+ * SummaryInformation#getThumbnail()} to do any useful
+ * manipulations, otherwise you'll get a
+ * NullPointerException
.
+ */
+ public Thumbnail()
+ {
+ super();
+ }
+
+
+
+ /**
+ *
+ */
+ public Thumbnail(byte[] thumbnailData)
+ {
+ this.thumbnailData = thumbnailData;
+ }
+
+
+
+ /**
+ * Returns the thumbnail as a byte[]
in
+ * {@link Variant#VT_CF VT_CF} format.
+ *
+ * @see SummaryInformation#getThumbnail()
+ */
+ public byte[] getThumbnail() {
+ return thumbnailData;
+ }
+
+
+
+ /**
+ * Sets the Thumbnail's underlying byte[]
in
+ * {@link Variant#VT_CF VT_CF} format.
+ *
+ * @see SummaryInformation#getThumbnail()
+ */
+ public void setThumbnail(byte[] thumbnail) {
+ this.thumbnailData = thumbnail;
+ }
+
+
+
+ /**
+ * Returns an int
representing the Clipboard
+ * Format Tag
+ * Possible return values are:
+ *
+ * - {@link #CFTAG_WINDOWS CFTAG_WINDOWS}
+ * - {@link #CFTAG_MACINTOSH CFTAG_MACINTOSH}
+ * - {@link #CFTAG_FMTID CFTAG_FMTID}
+ * - {@link #CFTAG_NODATA CFTAG_NODATA}
+ *
+ *
+ *
+ * @return a flag indicating the Clipboard Format Tag
+ */
+ public int getClipboardFormatTag()
+ {
+ DWord clipboardFormatTag = new DWord(getThumbnail(),OFFSET_CFTAG);
+ return clipboardFormatTag.intValue();
+ }
+
+
+
+ /**
+ * Returns an int
representing the Clipboard
+ * Format
+ *
+ * Will throw an exceptionif the Thumbnail's Clipboard
+ * Format Tag is not
+ * {@link Thumbnail#CFTAG_WINDOWS CFTAG_WINDOWS}
+ *
+ *
+ * Possible return values are:
+ *
+ * - {@link #CF_METAFILEPICT CF_METAFILEPICT}
+ * - {@link #CF_DIB CF_DIB}
+ * - {@link #CF_ENHMETAFILE CF_ENHMETAFILE}
+ * - {@link #CF_BITMAP CF_BITMAP}
+ *
+ *
+ *
+ * @return a flag indicating the Clipboard Format
+ *
+ * @throws HPSFException if the Thumbnail isn't CFTAG_WINDOWS
+ *
+ */
+ public int getClipboardFormat() throws HPSFException
+ {
+ if ( !(getClipboardFormatTag() == CFTAG_WINDOWS) )
+ {
+ throw new HPSFException("Clipboard Format Tag of Thumbnail must " +
+ "be CFTAG_WINDOWS.");
+ }
+
+ DWord clipboardFormat = new DWord(getThumbnail(),OFFSET_CF);
+ return clipboardFormat.intValue();
+ }
+
+
+
+ /**
+ * Returns the Thumbnail as a byte[]
+ * of WMF data if the Thumbnail's Clipboard Format Tag
+ * is {@link #CFTAG_WINDOWS CFTAG_WINDOWS}
+ * and its Clipboard Format is
+ * {@link #CF_METAFILEPICT CF_METAFILEPICT}
+ *
+ * This byte[]
is in the traditional WMF file,
+ * not the clipboard-specific version with special headers.
+ *
+ * See
+ * http://www.wvware.com/caolan/ora-wmf.html
+ * for more information on the WMF image format.
+ *
+ * @throws HPSFException if the Thumbnail isn't CFTAG_WINDOWS
+ * and CF_METAFILEPICT
+ *
+ * @return a WMF image of the Thumbnail
+ */
+ public byte[] getThumbnailAsWMF() throws HPSFException
+ {
+ if ( !(getClipboardFormatTag() == CFTAG_WINDOWS) )
+ {
+ throw new HPSFException("Clipboard Format Tag of Thumbnail must " +
+ "be CFTAG_WINDOWS.");
+ }
+ if ( !(getClipboardFormat() == CF_METAFILEPICT) )
+ {
+ throw new HPSFException("Clipboard Format of Thumbnail must " +
+ "be CF_METAFILEPICT.");
+ }
+ else
+ {
+ byte[] thumbnail = getThumbnail();
+ int wmfImageLength = thumbnail.length - OFFSET_WMFDATA;
+ byte[] wmfImage = new byte[wmfImageLength];
+ System.arraycopy(thumbnail,
+ OFFSET_WMFDATA,
+ wmfImage,
+ 0,
+ wmfImageLength);
+ return wmfImage;
+ }
+ }
+
+}
diff --git a/src/java/org/apache/poi/hpsf/UnexpectedPropertySetTypeException.java b/src/java/org/apache/poi/hpsf/UnexpectedPropertySetTypeException.java
index 1c297fb4d..d9da7d8f4 100644
--- a/src/java/org/apache/poi/hpsf/UnexpectedPropertySetTypeException.java
+++ b/src/java/org/apache/poi/hpsf/UnexpectedPropertySetTypeException.java
@@ -50,14 +50,6 @@
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* .
-*
-* Portions of this software are based upon public domain software
-* originally written at the National Center for Supercomputing Applications,
-* University of Illinois, Urbana-Champaign.
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
*/
package org.apache.poi.hpsf;
diff --git a/src/java/org/apache/poi/hpsf/Util.java b/src/java/org/apache/poi/hpsf/Util.java
index 9bcdba5d7..7ea6911cf 100644
--- a/src/java/org/apache/poi/hpsf/Util.java
+++ b/src/java/org/apache/poi/hpsf/Util.java
@@ -50,14 +50,6 @@
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* .
-*
-* Portions of this software are based upon public domain software
-* originally written at the National Center for Supercomputing Applications,
-* University of Illinois, Urbana-Champaign.
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
*/
package org.apache.poi.hpsf;
diff --git a/src/java/org/apache/poi/hpsf/Variant.java b/src/java/org/apache/poi/hpsf/Variant.java
index be17579fe..29de83917 100644
--- a/src/java/org/apache/poi/hpsf/Variant.java
+++ b/src/java/org/apache/poi/hpsf/Variant.java
@@ -50,14 +50,6 @@
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* .
-*
-* Portions of this software are based upon public domain software
-* originally written at the National Center for Supercomputing Applications,
-* University of Illinois, Urbana-Champaign.
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
*/
package org.apache.poi.hpsf;
@@ -307,9 +299,34 @@ public class Variant
public final static int VT_CF = 71;
/**
- * [P] A Class ID. How long is this? How is it to be
- * interpreted?
+ * [P] A Class ID.
+ * It consists of a 32 bit unsigned integer indicating the size
+ * of the structure, a 32 bit signed integer indicating (Clipboard
+ * Format Tag) indicating the type of data that it contains, and
+ * then a byte array containing the data.
+ *
+ * The valid Clipboard Format Tags are:
+ *
+ * - {@link Thumbnail#CFTAG_WINDOWS}
+ * - {@link Thumbnail#CFTAG_MACINTOSH}
+ * - {@link Thumbnail#CFTAG_NODATA}
+ * - {@link Thumbnail#CFTAG_FMTID}
+ *
+ *
+ *
+ *
typedef struct tagCLIPDATA {
+ * // cbSize is the size of the buffer pointed to
+ * // by pClipData, plus sizeof(ulClipFmt)
+ * ULONG cbSize;
+ * long ulClipFmt;
+ * BYTE* pClipData;
+ * } CLIPDATA;
+ * See
+ *
+ * msdn.microsoft.com/library/en-us/com/stgrstrc_0uwk.asp
+ *
+ *
*/
public final static int VT_CLSID = 72;
diff --git a/src/java/org/apache/poi/hpsf/wellknown/PropertyIDMap.java b/src/java/org/apache/poi/hpsf/wellknown/PropertyIDMap.java
index 74ebbbe85..4c0ca1893 100644
--- a/src/java/org/apache/poi/hpsf/wellknown/PropertyIDMap.java
+++ b/src/java/org/apache/poi/hpsf/wellknown/PropertyIDMap.java
@@ -50,14 +50,6 @@
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* .
-*
-* Portions of this software are based upon public domain software
-* originally written at the National Center for Supercomputing Applications,
-* University of Illinois, Urbana-Champaign.
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
*/
package org.apache.poi.hpsf.wellknown;
diff --git a/src/java/org/apache/poi/hpsf/wellknown/SectionIDMap.java b/src/java/org/apache/poi/hpsf/wellknown/SectionIDMap.java
index d42df09bf..ae90f9071 100644
--- a/src/java/org/apache/poi/hpsf/wellknown/SectionIDMap.java
+++ b/src/java/org/apache/poi/hpsf/wellknown/SectionIDMap.java
@@ -50,14 +50,6 @@
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* .
-*
-* Portions of this software are based upon public domain software
-* originally written at the National Center for Supercomputing Applications,
-* University of Illinois, Urbana-Champaign.
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
*/
package org.apache.poi.hpsf.wellknown;