23#include <com/sun/star/i18n/BreakType.hpp>
24#include <com/sun/star/i18n/ScriptType.hpp>
43 const css::lang::Locale& nLocale, sal_Int16 wordType)
52 if (
result.endPos < anyPos)
60 const css::lang::Locale& nLocale, sal_Int16 wordType)
69 if (
result.startPos > anyPos)
77 const css::lang::Locale& nLocale, sal_Int16 wordType,
sal_Bool bDirection )
92 return (cCh >= 0xAC00 && cCh <= 0xD7AF) || (cCh >= 0x1100 && cCh <= 0x11FF) ||
93 (cCh >= 0xA960 && cCh <= 0xA97F) || (cCh >= 0xD7B0 && cCh <= 0xD7FF) ||
94 (cCh >= 0x3130 && cCh <= 0x318F);
99 const OUString& Text, sal_Int32 nStartPos,
100 const css::lang::Locale& , sal_Int32 ,
101 const LineBreakHyphenationOptions& ,
102 const LineBreakUserOptions& bOptions )
104 LineBreakResults lbr;
106 const sal_Int32 nOldStartPos = nStartPos;
108 if (bOptions.allowPunctuationOutsideMargin &&
109 nStartPos !=
Text.getLength() &&
111 (
Text.iterateCodePoints( &nStartPos ), nStartPos ==
Text.getLength())) {
113 }
else if (bOptions.applyForbiddenRules && 0 < nStartPos && nStartPos <
Text.getLength()) {
115 while (nStartPos > 0 &&
116 (bOptions.forbiddenBeginCharacters.indexOf(
Text[nStartPos]) != -1 ||
117 bOptions.forbiddenEndCharacters.indexOf(
Text[nStartPos-1]) != -1))
118 Text.iterateCodePoints( &nStartPos, -1);
122 if (nOldStartPos == nStartPos && nStartPos <
Text.getLength()
123 && isHangul(
Text[nStartPos]))
125 while ( nStartPos >= 0 && isHangul(
Text[nStartPos] ) )
129 if ( nStartPos < nOldStartPos )
132 if ( nStartPos == 0 )
133 nStartPos = nOldStartPos;
136 lbr.breakIndex = nStartPos;
137 lbr.breakType = BreakType::WORDBOUNDARY;
141#define LOCALE(language, country) css::lang::Locale(language, country, OUString())
170 m_oDict->setJapaneseWordBreak();
#define LOCALE(language, country)
css::i18n::Boundary result
virtual sal_Int16 SAL_CALL getScriptType(const OUString &Text, sal_Int32 nPos) override
OUString hangingCharacters
css::i18n::LineBreakResults SAL_CALL getLineBreak(const OUString &Text, sal_Int32 nStartPos, const css::lang::Locale &nLocale, sal_Int32 nMinBreakPos, const css::i18n::LineBreakHyphenationOptions &hOptions, const css::i18n::LineBreakUserOptions &bOptions) override
css::i18n::Boundary SAL_CALL nextWord(const OUString &Text, sal_Int32 nStartPos, const css::lang::Locale &nLocale, sal_Int16 WordType) override
std::optional< xdictionary > m_oDict
css::i18n::Boundary SAL_CALL previousWord(const OUString &Text, sal_Int32 nStartPos, const css::lang::Locale &nLocale, sal_Int16 WordType) override
css::i18n::Boundary SAL_CALL getWordBoundary(const OUString &Text, sal_Int32 nPos, const css::lang::Locale &nLocale, sal_Int16 WordType, sal_Bool bDirection) override
const char * cBreakIterator
virtual css::i18n::Boundary SAL_CALL getWordBoundary(const OUString &Text, sal_Int32 nPos, const css::lang::Locale &nLocale, sal_Int16 WordType, sal_Bool bDirection) override
virtual css::i18n::Boundary SAL_CALL previousWord(const OUString &Text, sal_Int32 nStartPos, const css::lang::Locale &nLocale, sal_Int16 WordType) override
virtual css::i18n::Boundary SAL_CALL nextWord(const OUString &Text, sal_Int32 nStartPos, const css::lang::Locale &nLocale, sal_Int16 WordType) override
static rtl::Reference< LocaleDataImpl > get()
Constant values shared between i18npool and, for example, the number formatter.