Esempio n. 1
0
inline bool needsLineBreakIterator(UChar ch)
{
    if (wordBreakSwitch == KeepAll)
        return false;
    if (wordBreakSwitch == KeepAllIfKorean && isKorean(ch))
        return false;
    if (treatNoBreakSpaceAsBreak)
        return ch > asciiLineBreakTableLastChar;
    return ch > asciiLineBreakTableLastChar && ch != noBreakSpace;
}
Esempio n. 2
0
static inline bool shouldKeepAfter(UChar lastCh, UChar ch, UChar nextCh, LineBreakType lineBreakType)
{
    if (lineBreakType == LineBreakType::KeepAllIfKorean) {
        return isKorean(nextCh);
    }

    UChar preCh = U_MASK(u_charType(ch)) & U_GC_M_MASK ? lastCh : ch;
    return U_MASK(u_charType(preCh)) & (U_GC_L_MASK | U_GC_N_MASK)
        && !WTF::Unicode::hasLineBreakingPropertyComplexContext(preCh)
        && U_MASK(u_charType(nextCh)) & (U_GC_L_MASK | U_GC_N_MASK)
        && !WTF::Unicode::hasLineBreakingPropertyComplexContext(nextCh);
}