Examples of ObjRecord


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

                    }
                    break;
                }
                i++;
            } else if (rec instanceof ObjRecord) {
                ObjRecord obj = (ObjRecord) rec;
                SubRecord sub = obj.getSubRecords().get(0);
                if (sub instanceof CommonObjectDataSubRecord) {
                    CommonObjectDataSubRecord cmo = (CommonObjectDataSubRecord) sub;
                    if (cmo.getObjectType() == CommonObjectDataSubRecord.OBJECT_TYPE_COMMENT) {
                        //map ObjectId and corresponding TextObjectRecord,
                        //it will be used to match NoteRecord and TextObjectRecord
View Full Code Here

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

     */
    private ObjRecord createObjRecord( HSSFShape hssfShape, int shapeId )
    {
        HSSFShape shape = hssfShape;

        ObjRecord obj = new ObjRecord();
        CommonObjectDataSubRecord c = new CommonObjectDataSubRecord();
        c.setObjectType( (short) ( (HSSFSimpleShape) shape ).getShapeType() );
        c.setObjectId( (short) ( shapeId ) );
        c.setLocked( true );
        c.setPrintable( true );
        c.setAutofill( true );
        c.setAutoline( true );
        EndSubRecord e = new EndSubRecord();

        obj.addSubRecord( c );
        obj.addSubRecord( e );

        return obj;
    }
View Full Code Here

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

     */
    private ObjRecord createObjRecord( HSSFShape hssfShape, int shapeId )
    {
        HSSFShape shape = hssfShape;

        ObjRecord obj = new ObjRecord();
        CommonObjectDataSubRecord c = new CommonObjectDataSubRecord();
        c.setObjectType( OBJECT_TYPE_MICROSOFT_OFFICE_DRAWING );
        c.setObjectId( (short) ( shapeId ) );
        c.setLocked( true );
        c.setPrintable( true );
        c.setAutofill( true );
        c.setAutoline( true );
        EndSubRecord e = new EndSubRecord();

        obj.addSubRecord( c );
        obj.addSubRecord( e );

        return obj;
    }
View Full Code Here

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

                    }
                    break;
                }
                i++;
            } else if (rec instanceof ObjRecord) {
                ObjRecord obj = (ObjRecord) rec;
                SubRecord sub = obj.getSubRecords().get(0);
                if (sub instanceof CommonObjectDataSubRecord) {
                    CommonObjectDataSubRecord cmo = (CommonObjectDataSubRecord) sub;
                    if (cmo.getObjectType() == CommonObjectDataSubRecord.OBJECT_TYPE_COMMENT) {
                        //map ObjectId and corresponding TextObjectRecord,
                        //it will be used to match NoteRecord and TextObjectRecord
View Full Code Here

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

                    }
                    break;
                }
                i++;
            } else if (rec instanceof ObjRecord) {
                ObjRecord obj = (ObjRecord) rec;
                SubRecord sub = obj.getSubRecords().get(0);
                if (sub instanceof CommonObjectDataSubRecord) {
                    CommonObjectDataSubRecord cmo = (CommonObjectDataSubRecord) sub;
                    if (cmo.getObjectType() == CommonObjectDataSubRecord.OBJECT_TYPE_COMMENT) {
                        //find the next TextObjectRecord which holds the comment's text
                        //the order of TXO matches the order of NoteRecords: i-th TXO record corresponds to the i-th NoteRecord
View Full Code Here

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

                    }
                    break;
                }
                i++;
            } else if (rec instanceof ObjRecord) {
                ObjRecord obj = (ObjRecord) rec;
                SubRecord sub = obj.getSubRecords().get(0);
                if (sub instanceof CommonObjectDataSubRecord) {
                    CommonObjectDataSubRecord cmo = (CommonObjectDataSubRecord) sub;
                    if (cmo.getObjectType() == CommonObjectDataSubRecord.OBJECT_TYPE_COMMENT) {
                        //map ObjectId and corresponding TextObjectRecord,
                        //it will be used to match NoteRecord and TextObjectRecord
View Full Code Here

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

    {
        super(hssfShape, shapeId);

        _note = createNoteRecord(hssfShape, shapeId);

        ObjRecord obj = getObjRecord();
        List<SubRecord> records = obj.getSubRecords();
        int cmoIdx = 0;
        for (int i = 0; i < records.size(); i++) {
            Object r = records.get(i);

            if (r instanceof CommonObjectDataSubRecord){
                //modify autofill attribute inherited from <code>TextObjectRecord</code>
                CommonObjectDataSubRecord cmo = (CommonObjectDataSubRecord)r;
                cmo.setAutofill(false);
                cmoIdx = i;
            }
        }
        //add NoteStructure sub record
        //we don't know it's format, for now the record data is empty
        NoteStructureSubRecord u = new NoteStructureSubRecord();
        obj.addSubRecord(cmoIdx+1, u);
    }
View Full Code Here

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

     */
    private ObjRecord createObjRecord( HSSFShape hssfShape, int shapeId )
    {
        HSSFShape shape = hssfShape;

        ObjRecord obj = new ObjRecord();
        CommonObjectDataSubRecord c = new CommonObjectDataSubRecord();
        c.setObjectType( OBJECT_TYPE_MICROSOFT_OFFICE_DRAWING );
        c.setObjectId( getCmoObjectId(shapeId) );
        c.setLocked( true );
        c.setPrintable( true );
        c.setAutofill( true );
        c.setAutoline( true );
        EndSubRecord e = new EndSubRecord();

        obj.addSubRecord( c );
        obj.addSubRecord( e );

        return obj;
    }
View Full Code Here

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

     *                     workbook collection of pictures.
     *
     * @return newly created shape
     */
    public HSSFObjectData createObjectData(HSSFClientAnchor anchor, int storageId, int pictureIndex) {
        ObjRecord obj = new ObjRecord();

        CommonObjectDataSubRecord ftCmo = new CommonObjectDataSubRecord();
        ftCmo.setObjectType(CommonObjectDataSubRecord.OBJECT_TYPE_PICTURE);
        // ftCmo.setObjectId(oleShape.getShapeId()); ... will be set by onCreate(...)
        ftCmo.setLocked(true);
        ftCmo.setPrintable(true);
        ftCmo.setAutofill(true);
        ftCmo.setAutoline(true);
        ftCmo.setReserved1(0);
        ftCmo.setReserved2(0);
        ftCmo.setReserved3(0);
        obj.addSubRecord(ftCmo);
       
        // FtCf (pictFormat)
        FtCfSubRecord ftCf = new FtCfSubRecord();
        HSSFPictureData pictData = getSheet().getWorkbook().getAllPictures().get(pictureIndex-1);
        switch (pictData.getFormat()) {
          case HSSFWorkbook.PICTURE_TYPE_WMF:
          case HSSFWorkbook.PICTURE_TYPE_EMF:
            // this needs patch #49658 to be applied to actually work
              ftCf.setFlags(FtCfSubRecord.METAFILE_BIT);
              break;
          case HSSFWorkbook.PICTURE_TYPE_DIB:
          case HSSFWorkbook.PICTURE_TYPE_PNG:
          case HSSFWorkbook.PICTURE_TYPE_JPEG:
          case HSSFWorkbook.PICTURE_TYPE_PICT:
              ftCf.setFlags(FtCfSubRecord.BITMAP_BIT);
              break;
        }
        obj.addSubRecord(ftCf);
        // 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);
        DirectoryEntry oleRoot;
        try {
            DirectoryNode dn = _sheet.getWorkbook().getRootDirectory();
View Full Code Here

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

     */
    private ObjRecord createObjRecord( HSSFShape hssfShape, int shapeId )
    {
        HSSFShape shape = hssfShape;

        ObjRecord obj = new ObjRecord();
        CommonObjectDataSubRecord c = new CommonObjectDataSubRecord();
        c.setObjectType( (short) ( (HSSFSimpleShape) shape ).getShapeType() );
        c.setObjectIdgetCmoObjectId(shapeId) );
        c.setLocked( true );
        c.setPrintable( true );
        c.setAutofill( true );
        c.setAutoline( true );
        EndSubRecord e = new EndSubRecord();

        obj.addSubRecord( c );
        obj.addSubRecord( e );

        return obj;
    }
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.