Example #1
0
 /**
  * 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;
 }
Example #2
0
 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] + ")";
   }
 }
Example #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);
  }
Example #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);
  }
Example #5
0
 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";
 }
Example #6
0
 /**
  * Sets the version part of record
  *
  * @param value version part value
  */
 public void setVersion(short value) {
   _options = fVersion.setShortValue(_options, value);
 }
Example #7
0
 /**
  * Sets the instance part of record
  *
  * @param value instance part value
  */
 public void setInstance(short value) {
   _options = fInstance.setShortValue(_options, value);
 }
Example #8
0
 /**
  * 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);
 }
Example #9
0
 /** 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);
 }
Example #10
0
 /**
  * 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);
 }
 /** Sets the vertAlign field value. */
 public void setVertAlign(byte value) {
   field_1_rgf = (short) vertAlign.setValue(field_1_rgf, value);
 }
 /** @return the fVertRestart field value. */
 public boolean isFVertRestart() {
   return fVertRestart.isSet(field_1_rgf);
 }
 /** Sets the fVertRestart field value. */
 public void setFVertRestart(boolean value) {
   field_1_rgf = (short) fVertRestart.setBoolean(field_1_rgf, value);
 }
 /** @return the fVertMerge field value. */
 public boolean isFVertMerge() {
   return fVertMerge.isSet(field_1_rgf);
 }
 /** Sets the fVertMerge field value. */
 public void setFVertMerge(boolean value) {
   field_1_rgf = (short) fVertMerge.setBoolean(field_1_rgf, value);
 }
Example #16
0
 /**
  * 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);
 }
Example #17
0
 /**
  * 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);
 }
 /** @return the vertAlign field value. */
 public byte getVertAlign() {
   return (byte) vertAlign.getValue(field_1_rgf);
 }
Example #19
0
 /**
  * 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);
 }
Example #20
0
 /** 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);
 }
Example #21
0
 /**
  * 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);
 }
Example #22
0
 /**
  * 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);
 }
Example #23
0
 /**
  * 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);
 }
Example #24
0
 /**
  * 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);
 }
Example #25
0
 /**
  * Returns the instance part of the option record.
  *
  * @return The instance part of the record
  */
 public short getInstance() {
   return fInstance.getShortValue(_options);
 }
Example #26
0
 /**
  * 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);
 }
Example #27
0
 /**
  * Returns the version part of the option record.
  *
  * @return The version part of the option record
  */
 public short getVersion() {
   return fVersion.getShortValue(_options);
 }
Example #28
0
 /**
  * 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);
 }
Example #29
0
 /**
  * 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);
 }
Example #30
0
 /**
  * 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);
 }