LoadText.java
2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.xfa.text;
import com.adobe.xfa.text.StrAttr;
import com.adobe.xfa.text.StrItem;
import com.adobe.xfa.text.TextAttr;
import com.adobe.xfa.text.TextGfxSource;
import com.adobe.xfa.text.TextPosn;
import com.adobe.xfa.text.TextRange;
import com.adobe.xfa.text.TextStream;
class LoadText {
private TextStream mpoSource;
private int mnStartMajor;
private int mnStartMinor;
private int mnEndMajor;
private int mnEndMinor;
private final TextGfxSource moGfxSource;
private TextAttr mpoInitAttr;
LoadText(TextStream oSource, TextGfxSource oGfxSource) {
this.moGfxSource = oGfxSource;
this.mpoInitAttr = null;
TextRange oRangeAll = new TextRange(oSource, 0, Integer.MAX_VALUE);
this.initialize(oRangeAll.position(2), oRangeAll.position(3));
}
LoadText(TextPosn oStart, TextPosn oEnd, TextGfxSource oGfxSource) {
this.moGfxSource = oGfxSource;
this.mpoInitAttr = oStart.attributePtr();
this.initialize(oStart, oEnd);
}
int size() {
int nSize = this.mnEndMajor - this.mnStartMajor;
if (this.mnEndMinor > 0) {
++nSize;
}
if (this.mpoInitAttr != null) {
++nSize;
}
return nSize;
}
StrItem nextItem() {
StrItem poCopy2;
StrItem poCopy2;
if (this.mpoInitAttr != null) {
poCopy2 = new StrAttr(this.mpoInitAttr, this.moGfxSource, 0);
this.mpoInitAttr = null;
} else {
StrItem poSource = this.mpoSource.getItem(this.mnStartMajor);
int nCloneSize = this.mnStartMajor == this.mnEndMajor ? this.mnEndMinor - this.mnStartMinor : poSource.count() - this.mnStartMinor;
poCopy2 = poSource.clonePart(this.moGfxSource, this.mnStartMinor, nCloneSize);
++this.mnStartMajor;
this.mnStartMinor = 0;
}
return poCopy2;
}
int maxSize() {
return this.mpoSource.maxSize();
}
boolean allowNewLines() {
return this.mpoSource.allowNewLines();
}
private void initialize(TextPosn oStart, TextPosn oEnd) {
this.mpoSource = oStart.stream();
this.mnStartMajor = oStart.major();
this.mnStartMinor = oStart.minor();
this.mnEndMajor = oEnd.major();
this.mnEndMinor = oEnd.minor();
}
}