FrameCaret.java
1.38 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
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.xfa.text;
import com.adobe.xfa.text.DispLineWrapped;
import com.adobe.xfa.text.FrameLineHelper;
import com.adobe.xfa.text.TextSparseStream;
import com.adobe.xfa.ut.UnitSpan;
abstract class FrameCaret
extends FrameLineHelper {
private int meCaret = 0;
private int mnValidFrameIndex = 0;
private int mnValidLineIndex = 0;
private UnitSpan moValidOffset = UnitSpan.ZERO;
FrameCaret(TextSparseStream poStream, int eProcess) {
super(poStream, eProcess);
}
boolean success() {
return this.meCaret != 0;
}
@Override
protected boolean finish() {
if (this.meCaret != 0) {
this.setFrameIndex(this.mnValidFrameIndex);
this.setLineIndex(this.mnValidLineIndex);
this.setOffset(this.moValidOffset);
}
return true;
}
@Override
protected boolean processOneLine(DispLineWrapped poLine) {
int eCaret = this.processCaretLine(poLine);
if (eCaret != 0) {
this.meCaret = eCaret;
this.mnValidFrameIndex = this.getFrameIndex();
this.mnValidLineIndex = this.getLineIndex();
this.moValidOffset = this.getOffset();
if (eCaret == 2) {
return false;
}
}
return true;
}
abstract int processCaretLine(DispLineWrapped var1);
}