/** * 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; }
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] + ")"; } }
/** * 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); }
/** * 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); }
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"; }
/** * Sets the version part of record * * @param value version part value */ public void setVersion(short value) { _options = fVersion.setShortValue(_options, value); }
/** * Sets the instance part of record * * @param value instance part value */ public void setInstance(short value) { _options = fInstance.setShortValue(_options, value); }
/** * 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); }
/** 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * Returns the instance part of the option record. * * @return The instance part of the record */ public short getInstance() { return fInstance.getShortValue(_options); }
/** * 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); }
/** * Returns the version part of the option record. * * @return The version part of the option record */ public short getVersion() { return fVersion.getShortValue(_options); }
/** * 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); }
/** * 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); }
/** * 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); }