Examples of EmbeddedObjectRefSubRecord


Examples of org.apache.poi.hssf.record.EmbeddedObjectRefSubRecord

       
        HSSFObjectData obj = (HSSFObjectData)objects.get(0);
        assertNotNull(obj);
       
        // Peek inside the underlying record
        EmbeddedObjectRefSubRecord rec = obj.findObjectRecord();
        assertNotNull(rec);
       
        assertEquals(32, rec.field_1_stream_id_offset);
        assertEquals(0, rec.field_6_stream_id); // WRONG!
        assertEquals("Forms.CheckBox.1", rec.field_5_ole_classname);
View Full Code Here

Examples of org.apache.poi.hssf.record.EmbeddedObjectRefSubRecord

        HSSFObjectData obj = (HSSFObjectData)objects.get(0);
        assertNotNull(obj);

        // Peek inside the underlying record
        EmbeddedObjectRefSubRecord rec = obj.findObjectRecord();
        assertNotNull(rec);

//        assertEquals(32, rec.field_1_stream_id_offset);
        assertEquals(0, rec.getStreamId().intValue()); // WRONG!
        assertEquals("Forms.CheckBox.1", rec.getOLEClassName());
        assertEquals(12, rec.getObjectData().length);

        // Doesn't have a directory
        assertFalse(obj.hasDirectoryEntry());
        assertNotNull(obj.getObjectData());
        assertEquals(12, obj.getObjectData().length);
View Full Code Here

Examples of org.apache.poi.hssf.record.EmbeddedObjectRefSubRecord

     *
     * @return the object data as an OLE2 directory.
     * @throws IOException if there was an error reading the data.
     */
    public DirectoryEntry getDirectory() throws IOException {
        EmbeddedObjectRefSubRecord subRecord = findObjectRecord();

        int streamId = subRecord.getStreamId().intValue();
        String streamName = "MBD" + HexDump.toHex(streamId);

        Entry entry = poifs.getRoot().getEntry(streamName);
        if (entry instanceof DirectoryEntry) {
            return (DirectoryEntry) entry;
View Full Code Here

Examples of org.apache.poi.hssf.record.EmbeddedObjectRefSubRecord

     * Does this ObjectData have an associated POIFS
     *  Directory Entry?
     * (Not all do, those that don't have a data portion)
     */
    public boolean hasDirectoryEntry() {
        EmbeddedObjectRefSubRecord subRecord = findObjectRecord();
       
        // 'stream id' field tells you
        Integer streamId = subRecord.getStreamId();
        return streamId != null && streamId.intValue() != 0;
    }
View Full Code Here

Examples of org.apache.poi.hssf.record.EmbeddedObjectRefSubRecord

        HSSFObjectData obj = (HSSFObjectData)objects.get(0);
        assertNotNull(obj);

        // Peek inside the underlying record
        EmbeddedObjectRefSubRecord rec = obj.findObjectRecord();
        assertNotNull(rec);

//        assertEquals(32, rec.field_1_stream_id_offset);
        assertEquals(0, rec.getStreamId().intValue()); // WRONG!
        assertEquals("Forms.CheckBox.1", rec.getOLEClassName());
        assertEquals(12, rec.getObjectData().length);

        // Doesn't have a directory
        assertFalse(obj.hasDirectoryEntry());
        assertNotNull(obj.getObjectData());
        assertEquals(12, obj.getObjectData().length);
View Full Code Here

Examples of org.apache.poi.hssf.record.EmbeddedObjectRefSubRecord

        HSSFObjectData obj = (HSSFObjectData)objects.get(0);
        assertNotNull(obj);

        // Peek inside the underlying record
        EmbeddedObjectRefSubRecord rec = obj.findObjectRecord();
        assertNotNull(rec);

//        assertEquals(32, rec.field_1_stream_id_offset);
        assertEquals(0, rec.getStreamId().intValue()); // WRONG!
        assertEquals("Forms.CheckBox.1", rec.getOLEClassName());
        assertEquals(12, rec.getObjectData().length);

        // Doesn't have a directory
        assertFalse(obj.hasDirectoryEntry());
        assertNotNull(obj.getObjectData());
        assertEquals(12, obj.getObjectData().length);
View Full Code Here

Examples of org.apache.poi.hssf.record.EmbeddedObjectRefSubRecord

     *
     * @return the object data as an OLE2 directory.
     * @throws IOException if there was an error reading the data.
     */
    public DirectoryEntry getDirectory() throws IOException {
        EmbeddedObjectRefSubRecord subRecord = findObjectRecord();

        int streamId = subRecord.getStreamId().intValue();
        String streamName = "MBD" + HexDump.toHex(streamId);

        Entry entry = _root.getEntry(streamName);
        if (entry instanceof DirectoryEntry) {
            return (DirectoryEntry) entry;
View Full Code Here

Examples of org.apache.poi.hssf.record.EmbeddedObjectRefSubRecord

     * Does this ObjectData have an associated POIFS
     *  Directory Entry?
     * (Not all do, those that don't have a data portion)
     */
    public boolean hasDirectoryEntry() {
        EmbeddedObjectRefSubRecord subRecord = findObjectRecord();

        // 'stream id' field tells you
        Integer streamId = subRecord.getStreamId();
        return streamId != null && streamId.intValue() != 0;
    }
View Full Code Here

Examples of org.apache.poi.hssf.record.EmbeddedObjectRefSubRecord

        // FtPioGrbit (pictFlags)
        FtPioGrbitSubRecord ftPioGrbit = new FtPioGrbitSubRecord();
        ftPioGrbit.setFlagByBit(FtPioGrbitSubRecord.AUTO_PICT_BIT, true);
        obj.addSubRecord(ftPioGrbit);
       
        EmbeddedObjectRefSubRecord ftPictFmla = new EmbeddedObjectRefSubRecord();
        ftPictFmla.setUnknownFormulaData(new byte[]{2, 0, 0, 0, 0});
        ftPictFmla.setOleClassname("Paket");
        ftPictFmla.setStorageId(storageId);
       
        obj.addSubRecord(ftPictFmla);
        obj.addSubRecord(new EndSubRecord());

        String entryName = "MBD"+HexDump.toHex(storageId);
View Full Code Here

Examples of org.apache.poi.hssf.record.EmbeddedObjectRefSubRecord

        HSSFObjectData obj = (HSSFObjectData)objects.get(0);
        assertNotNull(obj);

        // Peek inside the underlying record
        EmbeddedObjectRefSubRecord rec = obj.findObjectRecord();
        assertNotNull(rec);

//        assertEquals(32, rec.field_1_stream_id_offset);
        assertEquals(0, rec.getStreamId().intValue()); // WRONG!
        assertEquals("Forms.CheckBox.1", rec.getOLEClassName());
        assertEquals(12, rec.getObjectData().length);

        // Doesn't have a directory
        assertFalse(obj.hasDirectoryEntry());
        assertNotNull(obj.getObjectData());
        assertEquals(12, obj.getObjectData().length);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.