equal
deleted
inserted
replaced
34 class RTFAttributes |
34 class RTFAttributes |
35 { |
35 { |
36 static RTFAttribute attributes[]; |
36 static RTFAttribute attributes[]; |
37 |
37 |
38 static { |
38 static { |
39 Vector a = new Vector(); |
39 Vector<RTFAttribute> a = new Vector<RTFAttribute>(); |
40 int CHR = RTFAttribute.D_CHARACTER; |
40 int CHR = RTFAttribute.D_CHARACTER; |
41 int PGF = RTFAttribute.D_PARAGRAPH; |
41 int PGF = RTFAttribute.D_PARAGRAPH; |
42 int SEC = RTFAttribute.D_SECTION; |
42 int SEC = RTFAttribute.D_SECTION; |
43 int DOC = RTFAttribute.D_DOCUMENT; |
43 int DOC = RTFAttribute.D_DOCUMENT; |
44 int PST = RTFAttribute.D_META; |
44 int PST = RTFAttribute.D_META; |
129 RTFAttribute[] attrs = new RTFAttribute[a.size()]; |
129 RTFAttribute[] attrs = new RTFAttribute[a.size()]; |
130 a.copyInto(attrs); |
130 a.copyInto(attrs); |
131 attributes = attrs; |
131 attributes = attrs; |
132 } |
132 } |
133 |
133 |
134 static Dictionary attributesByKeyword() |
134 static Dictionary<String, RTFAttribute> attributesByKeyword() |
135 { |
135 { |
136 Dictionary d = new Hashtable(attributes.length); |
136 Dictionary<String, RTFAttribute> d = new Hashtable<String, RTFAttribute>(attributes.length); |
137 int i, m; |
137 |
138 |
138 for (RTFAttribute attribute : attributes) { |
139 m = attributes.length; |
139 d.put(attribute.rtfName(), attribute); |
140 for(i = 0; i < m; i++) |
140 } |
141 d.put(attributes[i].rtfName(), attributes[i]); |
|
142 |
141 |
143 return d; |
142 return d; |
144 } |
143 } |
145 |
144 |
146 /************************************************************************/ |
145 /************************************************************************/ |