ZLTextParagraphBuilder::ZLTextParagraphBuilder(const std::string &language, const ZLTextParagraph ¶graph, const std::vector<ZLTextMark> &marks, int paragraphIndex, ZLTextElementVector &elements) : myParagraph(paragraph), myElements(elements), myLanguage(language), myBaseBidiLevel(ZLLanguageUtil::isRTLLanguage(language) ? 1 : 0) { myFirstMark = std::lower_bound(marks.begin(), marks.end(), ZLTextMark(paragraphIndex, 0, 0)); myLastMark = myFirstMark; for (; (myLastMark != marks.end()) && (myLastMark->ParagraphIndex == paragraphIndex); ++myLastMark) { } myOffset = 0; static bool lineBreakInitialized = false; if (!lineBreakInitialized) { init_linebreak(); lineBreakInitialized = true; } }
ZLTextParagraphCursor::Builder::Builder(ZLTextParagraphCursor &cursor) : myParagraph(*cursor.myModel[cursor.myIndex]), myElements(cursor.myElements), myLanguage(cursor.myModel.language()), myBaseBidiLevel(cursor.myModel.isRtl() ? 1 : 0) { const int paragraphIndex = cursor.myIndex; const std::vector<ZLTextMark> &marks = cursor.myModel.marks(); myFirstMark = std::lower_bound(marks.begin(), marks.end(), ZLTextMark(paragraphIndex, 0, 0)); myLastMark = myFirstMark; for (; (myLastMark != marks.end()) && (myLastMark->ParagraphIndex == paragraphIndex); ++myLastMark) { } myOffset = 0; static bool lineBreakInitialized = false; if (!lineBreakInitialized) { init_linebreak(); lineBreakInitialized = true; } }
void Java_org_vimgadgets_linebreak_LineBreaker_init(JNIEnv *env, jobject thiz) { init_linebreak(); }