*/
public long getClipboardFormatTag()
{
- long clipboardFormatTag = LittleEndian.getUInt(getThumbnail(),
+ long clipboardFormatTag = LittleEndian.getInt(getThumbnail(),
OFFSET_CFTAG);
return clipboardFormatTag;
}
throw new HPSFException("Clipboard Format Tag of Thumbnail must " +
"be CFTAG_WINDOWS.");
- return LittleEndian.getUInt(getThumbnail(), OFFSET_CF);
+ return LittleEndian.getInt(getThumbnail(), OFFSET_CF);
}
import junit.framework.TestCase;
import org.apache.poi.POIDataSamples;
+import org.apache.poi.hpsf.Thumbnail;
import org.apache.poi.hssf.HSSFTestDataSamples;
import org.apache.poi.hssf.extractor.ExcelExtractor;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
assertTrue(txt.indexOf("PID_REVNUMBER") != -1);
assertTrue(txt.indexOf("PID_THUMBNAIL") != -1);
}
+
+ public void testThumbnail() throws Exception {
+ POIFSFileSystem fs = new POIFSFileSystem(_samples.openResourceAsStream("TestThumbnail.xls"));
+ HSSFWorkbook wb = new HSSFWorkbook(fs);
+ Thumbnail thumbnail = new Thumbnail(wb.getSummaryInformation().getThumbnail());
+ assertEquals(-1, thumbnail.getClipboardFormatTag());
+ assertEquals(3, thumbnail.getClipboardFormat());
+ assertNotNull(thumbnail.getThumbnailAsWMF());
+ wb.close();
+ }
}