Package org.apache.poi.hslf.exceptions

Examples of org.apache.poi.hslf.exceptions.HSLFException


        public int checksum;

        public void read(byte[] data, int offset){
            int pos = offset;
            int key = LittleEndian.getInt(data, pos); pos += LittleEndian.INT_SIZE; //header key
            if (key != APMHEADER_KEY) throw new HSLFException("Not a valid WMF file");

            handle = LittleEndian.getUShort(data, pos); pos += LittleEndian.SHORT_SIZE;
            left = LittleEndian.getUShort(data, pos); pos += LittleEndian.SHORT_SIZE;
            top = LittleEndian.getUShort(data, pos); pos += LittleEndian.SHORT_SIZE;
            right = LittleEndian.getUShort(data, pos); pos += LittleEndian.SHORT_SIZE;
View Full Code Here


                out.write(chunk,0,count);
            }
            inflater.close();
            return out.toByteArray();
        } catch (IOException e){
            throw new HSLFException(e);
        }
    }
View Full Code Here

        // Update and write out the Current User atom
        int oldLastUserEditAtomPos = (int)currentUser.getCurrentEditOffset();
        Integer newLastUserEditAtomPos = (Integer)oldToNewPositions.get(new Integer(oldLastUserEditAtomPos));
        if(newLastUserEditAtomPos == null) {
            throw new HSLFException("Couldn't find the new location of the UserEditAtom that used to be at " + oldLastUserEditAtomPos);
        }
        currentUser.setCurrentEditOffset(newLastUserEditAtomPos.intValue());
        currentUser.writeToFS(outFS);
        writtenEntries.add("Current User");
View Full Code Here

        Record record = _records[i];
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        try {
                record.writeOut(out);
            } catch (IOException e){
                throw new HSLFException(e);
            }

              // Grab interesting records as they come past
        if(_records[i].getRecordType() == RecordTypes.PersistPtrIncrementalBlock.typeID){
          ptr = (PersistPtrHolder)_records[i];
View Full Code Here

        try {
            FileInputStream is = new FileInputStream(pict);
            is.read(data);
            is.close();
        } catch (IOException e){
            throw new HSLFException(e);
        }
        return addPicture(data, format);
    }
View Full Code Here

        // Update and write out the Current User atom
        int oldLastUserEditAtomPos = (int)currentUser.getCurrentEditOffset();
        Integer newLastUserEditAtomPos = (Integer)oldToNewPositions.get(Integer.valueOf(oldLastUserEditAtomPos));
        if(newLastUserEditAtomPos == null) {
            throw new HSLFException("Couldn't find the new location of the UserEditAtom that used to be at " + oldLastUserEditAtomPos);
        }
        currentUser.setCurrentEditOffset(newLastUserEditAtomPos.intValue());
        currentUser.writeToFS(outFS);
        writtenEntries.add("Current User");
View Full Code Here

        // Update and write out the Current User atom
        int oldLastUserEditAtomPos = (int)currentUser.getCurrentEditOffset();
        Integer newLastUserEditAtomPos = oldToNewPositions.get(oldLastUserEditAtomPos);
        if(usr == null || newLastUserEditAtomPos == null || usr.getLastOnDiskOffset() != newLastUserEditAtomPos) {
            throw new HSLFException("Couldn't find the new location of the last UserEditAtom that used to be at " + oldLastUserEditAtomPos);
        }
        currentUser.setCurrentEditOffset(usr.getLastOnDiskOffset());
  }
View Full Code Here

            ppdrawing.addTextboxWrapper(_txtbox);
            // Ensure the escher layer knows about the added records
            try {
                _txtbox.writeOut(null);
            } catch (IOException e){
                throw new HSLFException(e);
            }
            if(getAnchor().equals(new Rectangle()) && !"".equals(getText())) resizeToFitText();
        }
        if(_txtrun != null) {
            _txtrun.setShapeId(getShapeId());
View Full Code Here

     */
    public Graphics create() {
        try {
            return (Graphics)clone();
        } catch (CloneNotSupportedException e){
            throw new HSLFException(e);
        }
    }
View Full Code Here

          ByteArrayOutputStream bos = new ByteArrayOutputStream();
          poiData.writeFilesystem(bos);
          exOleObjStg.setData(bos.toByteArray());
        } catch (IOException e) {
          throw new HSLFException(e);
        }
       
        int psrId = addPersistentObject(exOleObjStg);
        exOleObjStg.setPersistId(psrId);
        eeAtom.setObjStgDataRef(psrId);
View Full Code Here

TOP

Related Classes of org.apache.poi.hslf.exceptions.HSLFException

Copyright © 2018 www.massapicom. 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.