MCPcopy Create free account
hub / github.com/apache/poi / TextObjectRecord

Class TextObjectRecord

src/java/org/apache/poi/hssf/record/TextObjectRecord.java:37–344  ·  view source on GitHub ↗

The TXO record (0x01B6) is used to define the properties of a text box. It is followed by two or more continue records unless there is no actual text. The first continue records contain the text data and the last continue record contains the formatting runs. @author Glen Stampoultzis (glens at

Source from the content-addressed store, hash-verified

35 * @author Glen Stampoultzis (glens at apache.org)
36 */
37public final class TextObjectRecord extends ContinuableRecord {
38 public final static short sid = 0x01B6;
39
40 private static final int FORMAT_RUN_ENCODED_SIZE = 8; // 2 shorts and 4 bytes reserved
41
42 private static final BitField HorizontalTextAlignment = BitFieldFactory.getInstance(0x000E);
43 private static final BitField VerticalTextAlignment = BitFieldFactory.getInstance(0x0070);
44 private static final BitField textLocked = BitFieldFactory.getInstance(0x0200);
45
46 public final static short HORIZONTAL_TEXT_ALIGNMENT_LEFT_ALIGNED = 1;
47 public final static short HORIZONTAL_TEXT_ALIGNMENT_CENTERED = 2;
48 public final static short HORIZONTAL_TEXT_ALIGNMENT_RIGHT_ALIGNED = 3;
49 public final static short HORIZONTAL_TEXT_ALIGNMENT_JUSTIFIED = 4;
50 public final static short VERTICAL_TEXT_ALIGNMENT_TOP = 1;
51 public final static short VERTICAL_TEXT_ALIGNMENT_CENTER = 2;
52 public final static short VERTICAL_TEXT_ALIGNMENT_BOTTOM = 3;
53 public final static short VERTICAL_TEXT_ALIGNMENT_JUSTIFY = 4;
54
55 public final static short TEXT_ORIENTATION_NONE = 0;
56 public final static short TEXT_ORIENTATION_TOP_TO_BOTTOM = 1;
57 public final static short TEXT_ORIENTATION_ROT_RIGHT = 2;
58 public final static short TEXT_ORIENTATION_ROT_LEFT = 3;
59
60 private int field_1_options;
61 private int field_2_textOrientation;
62 private int field_3_reserved4;
63 private int field_4_reserved5;
64 private int field_5_reserved6;
65 private int field_8_reserved7;
66
67 private HSSFRichTextString _text;
68
69 /*
70 * Note - the next three fields are very similar to those on
71 * EmbededObjectRefSubRecord(ftPictFmla 0x0009)
72 *
73 * some observed values for the 4 bytes preceding the formula: C0 5E 86 03
74 * C0 11 AC 02 80 F1 8A 03 D4 F0 8A 03
75 */
76 private int _unknownPreFormulaInt;
77 /** expect tRef, tRef3D, tArea, tArea3D or tName */
78 private OperandPtg _linkRefPtg;
79 /**
80 * Not clear if needed . Excel seems to be OK if this byte is not present.
81 * Value is often the same as the earlier firstColumn byte. */
82 private Byte _unknownPostFormulaByte;
83
84 public TextObjectRecord() {
85 //
86 }
87
88 public TextObjectRecord(RecordInputStream in) {
89 field_1_options = in.readUShort();
90 field_2_textOrientation = in.readUShort();
91 field_3_reserved4 = in.readUShort();
92 field_4_reserved5 = in.readUShort();
93 field_5_reserved6 = in.readUShort();
94 int field_6_textLength = in.readUShort();

Callers

nothing calls this directly

Calls 1

getInstanceMethod · 0.95

Tested by

no test coverage detected