Package org.apache.poi.hssf.record

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


   * @return the ProtectRecord. If one is not contained in the sheet, then one
   *         is created.
   */
  private ProtectRecord getProtect() {
    if (_protectRecord == null) {
      _protectRecord = new ProtectRecord(false);
    }
    return _protectRecord;
  }
View Full Code Here


      _objectProtectRecord = null;
      _scenarioProtectRecord = null;
      return;
    }

    ProtectRecord prec = getProtect();
    PasswordRecord pass = getPassword();
    prec.setProtect(true);
    pass.setPassword(PasswordRecord.hashPassword(password));
    if (_objectProtectRecord == null && shouldProtectObjects) {
      ObjectProtectRecord rec = createObjectProtect();
      rec.setProtect(true);
      _objectProtectRecord = rec;
View Full Code Here

     * @return a new Protect record with protect set to false.
     */
    private static ProtectRecord createProtect() {
        // by default even when we support it we won't
        // want it to be protected
        return new ProtectRecord(false);
    }
View Full Code Here

   * @return the ProtectRecord. If one is not contained in the sheet, then one
   *         is created.
   */
  private ProtectRecord getProtect() {
    if (_protectRecord == null) {
      _protectRecord = new ProtectRecord(false);
    }
    return _protectRecord;
  }
View Full Code Here

      _objectProtectRecord = null;
      _scenarioProtectRecord = null;
      return;
    }

    ProtectRecord prec = getProtect();
    PasswordRecord pass = getPassword();
    prec.setProtect(true);
    pass.setPassword((short)CryptoFunctions.createXorVerifier1(password));
    if (_objectProtectRecord == null && shouldProtectObjects) {
      ObjectProtectRecord rec = createObjectProtect();
      rec.setProtect(true);
      _objectProtectRecord = rec;
View Full Code Here

     * @return a new Protect record with protect set to false.
     */
    private static ProtectRecord createProtect() {
        // by default even when we support it we won't
        // want it to be protected
        return new ProtectRecord(false);
    }
View Full Code Here

    return r;
  }

  private ProtectRecord createProtectRecord()
  {
    ProtectRecord r = new ProtectRecord();
    r.setProtect(false);
    return r;
  }
View Full Code Here

     */
    private static ProtectRecord createProtect() {
        if (log.check( POILogger.DEBUG )) {
            log.log(POILogger.DEBUG, "create protect record with protection disabled");
        }
        ProtectRecord retval = new ProtectRecord();
        retval.setProtect(false); // TODO - supply param to constructor
        return retval;
    }
View Full Code Here

     * @param objects are protected
     * @param scenarios are protected
     */
    public void protectSheet( String password, boolean objects, boolean scenarios ) {
        int protIdx = -1;
        ProtectRecord prec = getProtect();
        PasswordRecord pass = getPassword();
        prec.setProtect(true);
        pass.setPassword(PasswordRecord.hashPassword(password));
        if((objprotect == null && objects) || (scenprotect != null && scenarios)) {
            protIdx = records.indexOf( protect );
        }
        if(objprotect == null && objects) {
View Full Code Here

     * @param scenarios are unprotected (false = unprotect)
     */
    public void unprotectSheet( boolean sheet, boolean objects, boolean scenarios ) {

        if (!sheet) {
           ProtectRecord prec = getProtect();
           prec.setProtect(sheet);
           PasswordRecord pass = getPassword();
           pass.setPassword((short)00);
        }
        if(objprotect != null && !objects) {
            objprotect.setProtect(false);
View Full Code Here

TOP

Related Classes of org.apache.poi.hssf.record.ProtectRecord

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.