DispChange.java
3.43 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.xfa.text;
import com.adobe.xfa.text.TextStream;
class DispChange {
static final int CHANGE_NONE = 0;
static final int CHANGE_INSERT = 1;
static final int CHANGE_DELETE = 2;
static final int CHANGE_FRAME = 3;
static final int CHANGE_OTHER = 4;
static final int CHANGE_TO_END = 5;
static final int CHANGE_FULL = 6;
static final int CHANGE_FULL_FORCE_FRAMES = 7;
private TextStream mpoStream;
private int mnIndex;
private int mnCount;
private int meType;
private boolean mbJustify;
DispChange() {
this.reset();
}
final int type() {
return this.meType;
}
final TextStream stream() {
return this.mpoStream;
}
final int index() {
return this.mnIndex;
}
final int count() {
return this.mnCount;
}
final boolean justify() {
return this.mbJustify;
}
final void insert(TextStream poStream, int nIndex, int nCount) {
this.simpleChange(1, poStream, nIndex, nCount);
}
final void delete(TextStream poStream, int nIndex, int nCount) {
this.simpleChange(2, poStream, nIndex, nCount);
}
final void frame(TextStream poStream, int nIndex, int nCount) {
this.simpleChange(3, poStream, nIndex, nCount);
}
final void other(TextStream poStream, int nIndex, int nCount) {
if (this.meType == 0) {
this.meType = 4;
this.mpoStream = poStream;
this.mnIndex = nIndex;
this.mnCount = nCount;
} else if (this.meType != 6 && this.meType != 5 && poStream == this.mpoStream) {
this.meType = 4;
int nOldEnd = this.mnIndex + this.mnCount;
int nNewEnd = nIndex + nCount;
if (nIndex < this.mnIndex) {
this.mnIndex = nIndex;
}
if (nNewEnd < nOldEnd) {
nNewEnd = nOldEnd;
}
this.mnCount = nNewEnd - this.mnIndex;
} else {
this.Full(this.meType == 5);
}
}
final void other(TextStream poStream, int nIndex) {
this.other(poStream, nIndex, 0);
}
final void toEnd(TextStream poStream, int nIndex) {
if (this.meType != 0) {
this.other(poStream, nIndex);
} else if (this.meType == 5) {
if (poStream == this.mpoStream) {
if (nIndex < this.mnIndex) {
this.mnIndex = nIndex;
}
} else {
this.Full(true);
}
} else {
this.meType = 5;
this.mpoStream = poStream;
this.mnIndex = nIndex;
this.mnCount = 0;
}
}
final void setJustify() {
this.mbJustify = true;
}
final void Full(boolean bForceAllFrames) {
this.meType = bForceAllFrames ? 7 : 6;
}
final void full() {
this.Full(false);
}
final void reset() {
this.meType = 0;
this.mpoStream = null;
this.mnIndex = 0;
this.mnCount = 0;
this.mbJustify = false;
}
private final void simpleChange(int eType, TextStream poStream, int nIndex, int nCount) {
if (this.meType != 0) {
this.other(poStream, nIndex);
} else {
this.meType = eType;
this.mpoStream = poStream;
this.mnIndex = nIndex;
this.mnCount = nCount;
}
}
}