FrameLineHelper.java 1.12 KB
/*
 * Decompiled with CFR 0_118.
 */
package com.adobe.xfa.text;

import com.adobe.xfa.text.DispLineWrapped;
import com.adobe.xfa.text.FrameHelper;
import com.adobe.xfa.text.TextFrame;
import com.adobe.xfa.text.TextSparseStream;

abstract class FrameLineHelper
extends FrameHelper {
    private DispLineWrapped mpoLine = null;

    FrameLineHelper(TextSparseStream poStream, int eProcess) {
        super(poStream, eProcess);
    }

    @Override
    protected boolean processOneFrame(TextFrame poFrame) {
        if (poFrame != null) {
            int nAbsLineIndex = this.getAbsLineIndex();
            int nLines = poFrame.getLineCount();
            for (int i = 0; i < nLines; ++i) {
                this.setLineIndex(i);
                this.setAbsLineIndex(nAbsLineIndex + i);
                this.mpoLine = poFrame.getLine(i);
                if (this.processOneLine(this.mpoLine)) continue;
                return false;
            }
        }
        return true;
    }

    @Override
    protected boolean finish() {
        this.mpoLine = null;
        return true;
    }

    abstract boolean processOneLine(DispLineWrapped var1);
}