コード例 #1
0
ファイル: EscherRecord.java プロジェクト: aw1621107/hacks
 /**
  * Set the options this this record. Container records should have the last nibble set to 0xF.
  *
  * <p
  * Note that <code>options</code> is an internal field. Use {@link #getInstance()} and
  * {@link #getVersion()} to access actual fields.
  */
 @Internal
 public void setOptions(short options) {
   // call to handle correct/incorrect values
   setVersion(fVersion.getShortValue(options));
   setInstance(fInstance.getShortValue(options));
   _options = options;
 }
コード例 #2
0
ファイル: AttrPtg.java プロジェクト: peke2/test_scala
 public String toFormulaString(String[] operands) {
   if (space.isSet(_options)) {
     return operands[0];
   } else if (optiIf.isSet(_options)) {
     return toFormulaString() + "(" + operands[0] + ")";
   } else if (optiSkip.isSet(_options)) {
     return toFormulaString()
         + operands[0]; // goto isn't a real formula element should not show up
   } else {
     return toFormulaString() + "(" + operands[0] + ")";
   }
 }
コード例 #3
0
  /**
   * set the actual string this contains
   *
   * @param string the text
   */
  public void setString(String string) {
    field_3_string = string;
    setCharCount((short) field_3_string.length());
    // scan for characters greater than 255 ... if any are
    // present, we have to use 16-bit encoding. Otherwise, we
    // can use 8-bit encoding
    boolean useUTF16 = false;
    int strlen = string.length();

    for (int j = 0; j < strlen; j++) {
      if (string.charAt(j) > 255) {
        useUTF16 = true;
        break;
      }
    }
    if (useUTF16)
      // Set the uncompressed bit
      field_2_optionflags = highByte.setByte(field_2_optionflags);
    else field_2_optionflags = highByte.clearByte(field_2_optionflags);
  }
コード例 #4
0
  /**
   * Adds a font run to the formatted string.
   *
   * <p>If a font run exists at the current charcter location, then it is replaced with the font run
   * to be added.
   */
  public void addFormatRun(FormatRun r) {
    if (field_4_format_runs == null) {
      field_4_format_runs = new ArrayList<FormatRun>();
    }

    int index = findFormatRunAt(r._character);
    if (index != -1) field_4_format_runs.remove(index);

    field_4_format_runs.add(r);
    // Need to sort the font runs to ensure that the font runs appear in
    // character order
    Collections.sort(field_4_format_runs);

    // Make sure that we now say that we are a rich string
    field_2_optionflags = richText.setByte(field_2_optionflags);
  }
コード例 #5
0
ファイル: AttrPtg.java プロジェクト: peke2/test_scala
 public String toFormulaString() {
   if (semiVolatile.isSet(_options)) {
     return "ATTR(semiVolatile)";
   }
   if (optiIf.isSet(_options)) {
     return "IF";
   }
   if (optiChoose.isSet(_options)) {
     return "CHOOSE";
   }
   if (optiSkip.isSet(_options)) {
     return "";
   }
   if (optiSum.isSet(_options)) {
     return "SUM";
   }
   if (baxcel.isSet(_options)) {
     return "ATTR(baxcel)";
   }
   if (space.isSet(_options)) {
     return "";
   }
   return "UNKNOWN ATTRIBUTE";
 }
コード例 #6
0
ファイル: EscherRecord.java プロジェクト: aw1621107/hacks
 /**
  * Sets the version part of record
  *
  * @param value version part value
  */
 public void setVersion(short value) {
   _options = fVersion.setShortValue(_options, value);
 }
コード例 #7
0
ファイル: EscherRecord.java プロジェクト: aw1621107/hacks
 /**
  * Sets the instance part of record
  *
  * @param value instance part value
  */
 public void setInstance(short value) {
   _options = fInstance.setShortValue(_options, value);
 }
コード例 #8
0
ファイル: LVLFAbstractType.java プロジェクト: aw1621107/hacks
 /**
  * Sets the fTentative field value. A bit that specifies whether the format of the level is
  * tentative
  */
 @Internal
 public void setFTentative(boolean value) {
   field_3_info = (byte) fTentative.setBoolean(field_3_info, value);
 }
コード例 #9
0
ファイル: LVLFAbstractType.java プロジェクト: aw1621107/hacks
 /** Sets the unused1 field value. This bit MUST be ignored */
 @Internal
 public void setUnused1(boolean value) {
   field_3_info = (byte) unused1.setBoolean(field_3_info, value);
 }
コード例 #10
0
ファイル: LVLFAbstractType.java プロジェクト: aw1621107/hacks
 /**
  * Sets the fConverted field value. A bit that specifies whether the nfc of this LVLF structure
  * was previously a temporary value used for bidirectional compatibility that was converted into a
  * standard MSONFC
  */
 @Internal
 public void setFConverted(boolean value) {
   field_3_info = (byte) fConverted.setBoolean(field_3_info, value);
 }
コード例 #11
0
 /** Sets the vertAlign field value. */
 public void setVertAlign(byte value) {
   field_1_rgf = (short) vertAlign.setValue(field_1_rgf, value);
 }
コード例 #12
0
 /** @return the fVertRestart field value. */
 public boolean isFVertRestart() {
   return fVertRestart.isSet(field_1_rgf);
 }
コード例 #13
0
 /** Sets the fVertRestart field value. */
 public void setFVertRestart(boolean value) {
   field_1_rgf = (short) fVertRestart.setBoolean(field_1_rgf, value);
 }
コード例 #14
0
 /** @return the fVertMerge field value. */
 public boolean isFVertMerge() {
   return fVertMerge.isSet(field_1_rgf);
 }
コード例 #15
0
 /** Sets the fVertMerge field value. */
 public void setFVertMerge(boolean value) {
   field_1_rgf = (short) fVertMerge.setBoolean(field_1_rgf, value);
 }
コード例 #16
0
ファイル: LVLFAbstractType.java プロジェクト: aw1621107/hacks
 /**
  * Sets the fIndentSav field value. A bit that specifies whether the level indented the text it
  * was applied to and that the indent needs to be removed when numbering is removed. The indent to
  * be removed is stored in dxaIndentSav
  */
 @Internal
 public void setFIndentSav(boolean value) {
   field_3_info = (byte) fIndentSav.setBoolean(field_3_info, value);
 }
コード例 #17
0
ファイル: LVLFAbstractType.java プロジェクト: aw1621107/hacks
 /**
  * A bit that specifies whether the level indented the text it was applied to and that the indent
  * needs to be removed when numbering is removed. The indent to be removed is stored in
  * dxaIndentSav
  *
  * @return the fIndentSav field value.
  */
 @Internal
 public boolean isFIndentSav() {
   return fIndentSav.isSet(field_3_info);
 }
コード例 #18
0
 /** @return the vertAlign field value. */
 public byte getVertAlign() {
   return (byte) vertAlign.getValue(field_1_rgf);
 }
コード例 #19
0
ファイル: LVLFAbstractType.java プロジェクト: aw1621107/hacks
 /**
  * A bit that specifies whether the nfc of this LVLF structure was previously a temporary value
  * used for bidirectional compatibility that was converted into a standard MSONFC
  *
  * @return the fConverted field value.
  */
 @Internal
 public boolean isFConverted() {
   return fConverted.isSet(field_3_info);
 }
コード例 #20
0
ファイル: LVLFAbstractType.java プロジェクト: aw1621107/hacks
 /** Sets the jc field value. An unsigned integer that specifies the justification of this level */
 @Internal
 public void setJc(byte value) {
   field_3_info = (byte) jc.setValue(field_3_info, value);
 }
コード例 #21
0
ファイル: LVLFAbstractType.java プロジェクト: aw1621107/hacks
 /**
  * This bit MUST be ignored
  *
  * @return the unused1 field value.
  * @deprecated This field should not be used according to specification
  */
 @Internal
 @Deprecated
 public boolean isUnused1() {
   return unused1.isSet(field_3_info);
 }
コード例 #22
0
ファイル: LVLFAbstractType.java プロジェクト: aw1621107/hacks
 /**
  * An unsigned integer that specifies the justification of this level
  *
  * @return the jc field value.
  */
 @Internal
 public byte getJc() {
   return (byte) jc.getValue(field_3_info);
 }
コード例 #23
0
ファイル: LVLFAbstractType.java プロジェクト: aw1621107/hacks
 /**
  * A bit that specifies whether the format of the level is tentative
  *
  * @return the fTentative field value.
  */
 @Internal
 public boolean isFTentative() {
   return fTentative.isSet(field_3_info);
 }
コード例 #24
0
ファイル: LVLFAbstractType.java プロジェクト: aw1621107/hacks
 /**
  * Sets the fLegal field value. A bit that specifies whether this level overrides the nfc of all
  * inherited level numbers. If the original nfc of a level number is msonfcArabicLZ, it is
  * preserved. Otherwise, the nfc of the level number is overridden by msonfcArabic.
  */
 @Internal
 public void setFLegal(boolean value) {
   field_3_info = (byte) fLegal.setBoolean(field_3_info, value);
 }
コード例 #25
0
ファイル: EscherRecord.java プロジェクト: aw1621107/hacks
 /**
  * Returns the instance part of the option record.
  *
  * @return The instance part of the record
  */
 public short getInstance() {
   return fInstance.getShortValue(_options);
 }
コード例 #26
0
ファイル: LVLFAbstractType.java プロジェクト: aw1621107/hacks
 /**
  * A bit that specifies whether this level overrides the nfc of all inherited level numbers. If
  * the original nfc of a level number is msonfcArabicLZ, it is preserved. Otherwise, the nfc of
  * the level number is overridden by msonfcArabic.
  *
  * @return the fLegal field value.
  */
 @Internal
 public boolean isFLegal() {
   return fLegal.isSet(field_3_info);
 }
コード例 #27
0
ファイル: EscherRecord.java プロジェクト: aw1621107/hacks
 /**
  * Returns the version part of the option record.
  *
  * @return The version part of the option record
  */
 public short getVersion() {
   return fVersion.getShortValue(_options);
 }
コード例 #28
0
ファイル: LVLFAbstractType.java プロジェクト: aw1621107/hacks
 /**
  * Sets the fNoRestart field value. A bit that specifies whether the number sequence of the level
  * does not restart after a level is encountered that is more significant than the level to which
  * this LVLF corresponds
  */
 @Internal
 public void setFNoRestart(boolean value) {
   field_3_info = (byte) fNoRestart.setBoolean(field_3_info, value);
 }
コード例 #29
0
ファイル: EscherRecord.java プロジェクト: aw1621107/hacks
 /**
  * Read the options field from header and return instance part of it.
  *
  * @param data the byte array to read from
  * @param offset the offset to start reading from
  * @return value of instance part of options field
  */
 protected static short readInstance(byte data[], int offset) {
   final short options = LittleEndian.getShort(data, offset);
   return fInstance.getShortValue(options);
 }
コード例 #30
0
ファイル: LVLFAbstractType.java プロジェクト: aw1621107/hacks
 /**
  * A bit that specifies whether the number sequence of the level does not restart after a level is
  * encountered that is more significant than the level to which this LVLF corresponds
  *
  * @return the fNoRestart field value.
  */
 @Internal
 public boolean isFNoRestart() {
   return fNoRestart.isSet(field_3_info);
 }